import java.util.*;

public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        s = s.replaceAll("C", "A");
        s = s.replaceAll("G", "A");
        s = s.replaceAll("T", "A");

        int ans = 0;

        int now = 0;

        for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        }

        if (now > ans) {
            ans = now;
        }

        // 出力
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        s = s.replaceAll("C", "A");
        s = s.replaceAll("G", "A");
        s = s.replaceAll("T", "A");

        int ans = 0;

        int now = 0;

        for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        }

        if (now > ans) {
            ans = now;
        }

        // 出力
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        s = s.replaceAll("C", "A");
        s = s.replaceAll("G", "A");
        s = s.replaceAll("T", "A");

        int ans = 0;

        int now = 0;

        for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        }

        if (now > ans) {
            ans = now;
        }

        // 出力
        System.out.println(ans);
    } main {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        s = s.replaceAll("C", "A");
        s = s.replaceAll("G", "A");
        s = s.replaceAll("T", "A");

        int ans = 0;

        int now = 0;

        for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        }

        if (now > ans) {
            ans = now;
        }

        // 出力
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc s = s.replaceAll("C", "A") s s.replaceAll("C", "A") s.replaceAll s "C" "A" s = s.replaceAll("G", "A") s s.replaceAll("G", "A") s.replaceAll s "G" "A" s = s.replaceAll("T", "A") s s.replaceAll("T", "A") s.replaceAll s "T" "A" int ans = 0; ans 0 int now = 0; now 0 for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        } String value s.split("") s.split s "" {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        } {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        } if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            } value.equals("A") value.equals value "A" {
                now++;
            } now++ now {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            } if (now > ans) {
                    ans = now;
                } now > ans now ans {
                    ans = now;
                } ans = now ans now now = 0 now 0 if (now > ans) {
            ans = now;
        } now > ans now ans {
            ans = now;
        } ans = now ans now System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        s = s.replaceAll("C", "A");
        s = s.replaceAll("G", "A");
        s = s.replaceAll("T", "A");

        int ans = 0;

        int now = 0;

        for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        }

        if (now > ans) {
            ans = now;
        }

        // 出力
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        s = s.replaceAll("C", "A");
        s = s.replaceAll("G", "A");
        s = s.replaceAll("T", "A");

        int ans = 0;

        int now = 0;

        for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        }

        if (now > ans) {
            ans = now;
        }

        // 出力
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        s = s.replaceAll("C", "A");
        s = s.replaceAll("G", "A");
        s = s.replaceAll("T", "A");

        int ans = 0;

        int now = 0;

        for(String value : s.split("")) {
            if (value.equals("A")) {
                now++;
            } else {
                if (now > ans) {
                    ans = now;
                }
                now = 0;
            }
        }

        if (now > ans) {
            ans = now;
        }

        // 出力
        System.out.println(ans);
    }
}