s = gets.chomps.split("")
s_re = s.reverse
s_size = s.s_size
i = 0
while true
    if s[i] == "A" || s[i] == "G" || s[i] == "C" || s[i] == "T"
        break
    else
        s.delete(s[i])
    end
    i += 1
end
i = 0
s = s.reverse
while true
    if s[i] == "A" || s[i] == "G" || s[i] == "C" || s[i] == "T"
        break
    else
        s.delete(s[i])
    end
    i += 1
end
puts s.size