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

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String target = "ATGC";
        int max = 0;
        
        for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        }
        
        System.out.println(max);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String target = "ATGC";
        int max = 0;
        
        for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        }
        
        System.out.println(max);
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String target = "ATGC";
        int max = 0;
        
        for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        }
        
        System.out.println(max);
    } main {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String target = "ATGC";
        int max = 0;
        
        for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        }
        
        System.out.println(max);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc String target = "ATGC"; target "ATGC" int max = 0; max 0 for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        } int l = 1; int l = 1; l 1 l <= str.length() l str.length() str.length str l++ l++ l {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        } {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        } for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            } int s = 0; int s = 0; s 0 s <= str.length() - l s str.length() - l str.length() str.length str l s++ s++ s {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            } {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            } boolean success = true; success true for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                } int j = s; int j = s; j s j < s + l j s + l s l j++ j++ j {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                } {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                } char c = str.charAt(j); c str.charAt(j) str.charAt str j if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    } target.indexOf(c) < 0 target.indexOf(c) target.indexOf target c 0 {
                        //System.out.print("failed");
                        success = false;
                        break;
                    } success = false success false break; if (success) {
                    max = l;
                    break;
                } success {
                    max = l;
                    break;
                } max = l max l break; System.out.println(max) System.out.println System.out System System.out max String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String target = "ATGC";
        int max = 0;
        
        for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        }
        
        System.out.println(max);
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String target = "ATGC";
        int max = 0;
        
        for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        }
        
        System.out.println(max);
    }
} Main
import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String target = "ATGC";
        int max = 0;
        
        for (int l = 1; l <= str.length(); l++) {
            for (int s = 0; s <= str.length() - l; s++) {
                boolean success = true;
                for (int j = s; j < s + l; j++) {
                    char c = str.charAt(j);
                    //System.out.print(c + " ");
                    if (target.indexOf(c) < 0) {
                        //System.out.print("failed");
                        success = false;
                        break;
                    }
                }
                if (success) {
                    max = l;
                    break;
                }
                //System.out.println();
            }
            //System.out.println("max=" + max);
            //System.out.println();
        }
        
        System.out.println(max);
    }
}
