/*
* @Author Silviase(@silviasetitech)
* For ProCon
*/

import java.util.*;
import java.lang.*;
import java.math.*;

class Main{

        

        // for dfs
        static int n;
        static int ansi;
        static int[] w;
        static int[] ww;
        static boolean[] isvisited;
        //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            
        String s = sc.next();
        int cnt = 0;
        int ans = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        }

        ans = Math.max(ans, cnt);
        System.out.println(ans);

        sc.close();
    }


        public static int gcd_int(int a, int b) {
        
            if (a < b) {
                int tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_int(b, a%b);
            }
        } 

        public static long gcd_long(long a, long b) {
        
            if (a < b) {
                long tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_long(b, a%b);
            }
        }

        public static int lcm_int(int a, int b) {
            int gcd = gcd_int(a,b);
            return a/gcd*b;
        }

        public static long lcm_long(long a, long b) {
            long gcd = gcd_long(a,b);
            return a/gcd*b;
        }

        public static void dfs(int placenow) {
            // if went all -> success! 
            // if not went all -> fail...
            
            /*
            dfs    
            Go All Place that there is way to and not having been yet. 

             if island 1 is start point, dfs(1);
            if there is way to island 2 and island 3,
            - island 2 changes non-visited -> visited, and dfs(2).
            - island 3 changes non-visited -> visited, and dfs(3).
    
            */

            isvisited[placenow] = true;
            boolean success = true;
            for (int i = 0; i < n; i++) {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            }
            if (success) {
                ansi++;
                isvisited[placenow] = false;
                return;
            }

            for (int i = 0; i < n; i++) {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            }
            isvisited[placenow] = false;
            return;
        }

}
 import java.util.*; util.* java import java.lang.*; lang.* java import java.math.*; math.* java class Main{

        

        // for dfs
        static int n;
        static int ansi;
        static int[] w;
        static int[] ww;
        static boolean[] isvisited;
        //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            
        String s = sc.next();
        int cnt = 0;
        int ans = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        }

        ans = Math.max(ans, cnt);
        System.out.println(ans);

        sc.close();
    }


        public static int gcd_int(int a, int b) {
        
            if (a < b) {
                int tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_int(b, a%b);
            }
        } 

        public static long gcd_long(long a, long b) {
        
            if (a < b) {
                long tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_long(b, a%b);
            }
        }

        public static int lcm_int(int a, int b) {
            int gcd = gcd_int(a,b);
            return a/gcd*b;
        }

        public static long lcm_long(long a, long b) {
            long gcd = gcd_long(a,b);
            return a/gcd*b;
        }

        public static void dfs(int placenow) {
            // if went all -> success! 
            // if not went all -> fail...
            
            /*
            dfs    
            Go All Place that there is way to and not having been yet. 

             if island 1 is start point, dfs(1);
            if there is way to island 2 and island 3,
            - island 2 changes non-visited -> visited, and dfs(2).
            - island 3 changes non-visited -> visited, and dfs(3).
    
            */

            isvisited[placenow] = true;
            boolean success = true;
            for (int i = 0; i < n; i++) {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            }
            if (success) {
                ansi++;
                isvisited[placenow] = false;
                return;
            }

            for (int i = 0; i < n; i++) {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            }
            isvisited[placenow] = false;
            return;
        }

} Main // for dfs
        static int n; n static int ansi; ansi static int[] w; w static int[] ww; ww static boolean[] isvisited; isvisited //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            
        String s = sc.next();
        int cnt = 0;
        int ans = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        }

        ans = Math.max(ans, cnt);
        System.out.println(ans);

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
            
        String s = sc.next();
        int cnt = 0;
        int ans = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        }

        ans = Math.max(ans, cnt);
        System.out.println(ans);

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int cnt = 0; cnt 0 int ans = 0; ans 0 for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        } {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        } if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            } s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' s.charAt(i) == 'G' s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' s.charAt(i) == 'A' s.charAt(i) s.charAt s i 'A' s.charAt(i) == 'T' s.charAt(i) s.charAt s i 'T' s.charAt(i) == 'G' s.charAt(i) s.charAt s i 'G' s.charAt(i) == 'C' s.charAt(i) s.charAt s i 'C' {
                cnt++;
            } cnt++ cnt {
                ans = Math.max(ans, cnt);
                cnt = 0;
            } ans = Math.max(ans, cnt) ans Math.max(ans, cnt) Math.max Math ans cnt cnt = 0 cnt 0 ans = Math.max(ans, cnt) ans Math.max(ans, cnt) Math.max Math ans cnt System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public static int gcd_int(int a, int b) {
        
            if (a < b) {
                int tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_int(b, a%b);
            }
        } gcd_int {
        
            if (a < b) {
                int tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_int(b, a%b);
            }
        } if (a < b) {
                int tmpp = a;
                a = b;
                b = tmpp;
            } a < b a b {
                int tmpp = a;
                a = b;
                b = tmpp;
            } int tmpp = a; tmpp a a = b a b b = tmpp b tmpp if (b == 0) {
                return a;
            }else{
                return gcd_int(b, a%b);
            } b == 0 b 0 {
                return a;
            } return a; a {
                return gcd_int(b, a%b);
            } return gcd_int(b, a%b); gcd_int(b, a%b) gcd_int b a%b a b int a a int b b public static long gcd_long(long a, long b) {
        
            if (a < b) {
                long tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_long(b, a%b);
            }
        } gcd_long {
        
            if (a < b) {
                long tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_long(b, a%b);
            }
        } if (a < b) {
                long tmpp = a;
                a = b;
                b = tmpp;
            } a < b a b {
                long tmpp = a;
                a = b;
                b = tmpp;
            } long tmpp = a; tmpp a a = b a b b = tmpp b tmpp if (b == 0) {
                return a;
            }else{
                return gcd_long(b, a%b);
            } b == 0 b 0 {
                return a;
            } return a; a {
                return gcd_long(b, a%b);
            } return gcd_long(b, a%b); gcd_long(b, a%b) gcd_long b a%b a b long a a long b b public static int lcm_int(int a, int b) {
            int gcd = gcd_int(a,b);
            return a/gcd*b;
        } lcm_int {
            int gcd = gcd_int(a,b);
            return a/gcd*b;
        } int gcd = gcd_int(a,b); gcd gcd_int(a,b) gcd_int a b return a/gcd*b; a/gcd*b a/gcd a gcd b int a a int b b public static long lcm_long(long a, long b) {
            long gcd = gcd_long(a,b);
            return a/gcd*b;
        } lcm_long {
            long gcd = gcd_long(a,b);
            return a/gcd*b;
        } long gcd = gcd_long(a,b); gcd gcd_long(a,b) gcd_long a b return a/gcd*b; a/gcd*b a/gcd a gcd b long a a long b b public static void dfs(int placenow) {
            // if went all -> success! 
            // if not went all -> fail...
            
            /*
            dfs    
            Go All Place that there is way to and not having been yet. 

             if island 1 is start point, dfs(1);
            if there is way to island 2 and island 3,
            - island 2 changes non-visited -> visited, and dfs(2).
            - island 3 changes non-visited -> visited, and dfs(3).
    
            */

            isvisited[placenow] = true;
            boolean success = true;
            for (int i = 0; i < n; i++) {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            }
            if (success) {
                ansi++;
                isvisited[placenow] = false;
                return;
            }

            for (int i = 0; i < n; i++) {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            }
            isvisited[placenow] = false;
            return;
        } dfs {
            // if went all -> success! 
            // if not went all -> fail...
            
            /*
            dfs    
            Go All Place that there is way to and not having been yet. 

             if island 1 is start point, dfs(1);
            if there is way to island 2 and island 3,
            - island 2 changes non-visited -> visited, and dfs(2).
            - island 3 changes non-visited -> visited, and dfs(3).
    
            */

            isvisited[placenow] = true;
            boolean success = true;
            for (int i = 0; i < n; i++) {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            }
            if (success) {
                ansi++;
                isvisited[placenow] = false;
                return;
            }

            for (int i = 0; i < n; i++) {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            }
            isvisited[placenow] = false;
            return;
        } isvisited[placenow] = true isvisited[placenow] isvisited placenow true boolean success = true; success true for (int i = 0; i < n; i++) {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            } {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            } if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                } isvisited[i] == false isvisited[i] isvisited i false { // not go all place
                    success = false;
                    break;
                } success = false success false break; if (success) {
                ansi++;
                isvisited[placenow] = false;
                return;
            } success {
                ansi++;
                isvisited[placenow] = false;
                return;
            } ansi++ ansi isvisited[placenow] = false isvisited[placenow] isvisited placenow false return; for (int i = 0; i < n; i++) {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            } {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            } if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                } w[i] == placenow && isvisited[ww[i]] == false w[i] == placenow w[i] w i placenow isvisited[ww[i]] == false isvisited[ww[i]] isvisited ww[i] ww i false {
                    dfs(ww[i]);
                } dfs(ww[i]) dfs ww[i] ww i if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                } ww[i] == placenow && isvisited[w[i]] == false ww[i] == placenow ww[i] ww i placenow isvisited[w[i]] == false isvisited[w[i]] isvisited w[i] w i false {
                    dfs(w[i]);
                } dfs(w[i]) dfs w[i] w i {
                    continue;
                } continue; isvisited[placenow] = false isvisited[placenow] isvisited placenow false return; int placenow placenow
/*
* @Author Silviase(@silviasetitech)
* For ProCon
*/

import java.util.*;
import java.lang.*;
import java.math.*;

class Main{

        

        // for dfs
        static int n;
        static int ansi;
        static int[] w;
        static int[] ww;
        static boolean[] isvisited;
        //
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            
        String s = sc.next();
        int cnt = 0;
        int ans = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'A' || 
            s.charAt(i) == 'T' ||
            s.charAt(i) == 'G' ||
            s.charAt(i) == 'C' ) {
                cnt++;
            } else {
                ans = Math.max(ans, cnt);
                cnt = 0;
            }
        }

        ans = Math.max(ans, cnt);
        System.out.println(ans);

        sc.close();
    }


        public static int gcd_int(int a, int b) {
        
            if (a < b) {
                int tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_int(b, a%b);
            }
        } 

        public static long gcd_long(long a, long b) {
        
            if (a < b) {
                long tmpp = a;
                a = b;
                b = tmpp;
            }
            if (b == 0) {
                return a;
            }else{
                return gcd_long(b, a%b);
            }
        }

        public static int lcm_int(int a, int b) {
            int gcd = gcd_int(a,b);
            return a/gcd*b;
        }

        public static long lcm_long(long a, long b) {
            long gcd = gcd_long(a,b);
            return a/gcd*b;
        }

        public static void dfs(int placenow) {
            // if went all -> success! 
            // if not went all -> fail...
            
            /*
            dfs    
            Go All Place that there is way to and not having been yet. 

             if island 1 is start point, dfs(1);
            if there is way to island 2 and island 3,
            - island 2 changes non-visited -> visited, and dfs(2).
            - island 3 changes non-visited -> visited, and dfs(3).
    
            */

            isvisited[placenow] = true;
            boolean success = true;
            for (int i = 0; i < n; i++) {
                if (isvisited[i] == false) { // not go all place
                    success = false;
                    break;
                }
            }
            if (success) {
                ansi++;
                isvisited[placenow] = false;
                return;
            }

            for (int i = 0; i < n; i++) {
                if (w[i] == placenow && isvisited[ww[i]] == false ) {
                    dfs(ww[i]);
                }else if(ww[i] == placenow && isvisited[w[i]] == false){
                    dfs(w[i]);
                }else{
                    continue;
                }
            }
            isvisited[placenow] = false;
            return;
        }

}

