import Control.Monad
import Control.Applicative
import Data.List


-- [a] <- map read . words <$> getLine => [1] -> a == 1
-- 1
-- a <- readLn
-- 1 2 3
-- lst <- map read . words <$> getLine => [1, 2, 3]
-- 1 2 3
-- [l, m, n] <- map read . words <$. getLine :: IO [Int] => [1, 2, 3]
-- 'a'
-- c <- getChar => c == 'a'
--
-- slst <- replicateM h getLine

-- getBysplit = map read . words <$> getLine

segments :: [a] -> [[a]]
segments = concat . scanr (\a b -> [a] : map (a:) b) []


solve :: [String] -> Int
solve = length . (filter func)

func :: String -> Bool
func s = ('A' `elem` s || 'C' `elem` s || 'G' `elem` s || 'T' `elem` s) && length s == 4


main :: IO()
main = do
  s <- getLine
  print $ (solve . segments) s

