import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] atgc = {'A', 'T', 'G', 'C'};
        
        int length = 0;
        int tmpLength = 0;
        boolean checkNow = false;
        for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        }
        if(checkNow) length = length < tmpLength ? tmpLength : length;
        
        System.out.println(length);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] atgc = {'A', 'T', 'G', 'C'};
        
        int length = 0;
        int tmpLength = 0;
        boolean checkNow = false;
        for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        }
        if(checkNow) length = length < tmpLength ? tmpLength : length;
        
        System.out.println(length);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] atgc = {'A', 'T', 'G', 'C'};
        
        int length = 0;
        int tmpLength = 0;
        boolean checkNow = false;
        for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        }
        if(checkNow) length = length < tmpLength ? tmpLength : length;
        
        System.out.println(length);
    } main {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] atgc = {'A', 'T', 'G', 'C'};
        
        int length = 0;
        int tmpLength = 0;
        boolean checkNow = false;
        for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        }
        if(checkNow) length = length < tmpLength ? tmpLength : length;
        
        System.out.println(length);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc char[] atgc = {'A', 'T', 'G', 'C'}; atgc {'A', 'T', 'G', 'C'} 'A' 'T' 'G' 'C' int length = 0; length 0 int tmpLength = 0; tmpLength 0 boolean checkNow = false; checkNow false for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        } {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        } boolean preCheckNow = false; preCheckNow false for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            } int j = 0; int j = 0; j 0 j < 4 j 4 j++ j++ j {
                if(s[i] == atgc[j]) preCheckNow = true;
            } {
                if(s[i] == atgc[j]) preCheckNow = true;
            } if(s[i] == atgc[j]) preCheckNow = true; s[i] == atgc[j] s[i] s i atgc[j] atgc j preCheckNow = true preCheckNow true if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            } preCheckNow {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            } if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                } checkNow tmpLength++ tmpLength {
                    checkNow = true;
                    tmpLength++;
                } checkNow = true checkNow true tmpLength++ tmpLength {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            } if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                } checkNow {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                } checkNow = false checkNow false length = length < tmpLength ? tmpLength : length length length < tmpLength ? tmpLength : length length < tmpLength length tmpLength tmpLength length tmpLength = 0 tmpLength 0 checkNow = preCheckNow checkNow preCheckNow if(checkNow) length = length < tmpLength ? tmpLength : length; checkNow length = length < tmpLength ? tmpLength : length length length < tmpLength ? tmpLength : length length < tmpLength length tmpLength tmpLength length System.out.println(length) System.out.println System.out System System.out length String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] atgc = {'A', 'T', 'G', 'C'};
        
        int length = 0;
        int tmpLength = 0;
        boolean checkNow = false;
        for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        }
        if(checkNow) length = length < tmpLength ? tmpLength : length;
        
        System.out.println(length);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] atgc = {'A', 'T', 'G', 'C'};
        
        int length = 0;
        int tmpLength = 0;
        boolean checkNow = false;
        for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        }
        if(checkNow) length = length < tmpLength ? tmpLength : length;
        
        System.out.println(length);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        char[] atgc = {'A', 'T', 'G', 'C'};
        
        int length = 0;
        int tmpLength = 0;
        boolean checkNow = false;
        for(int i = 0;i < s.length;i++) {
            // ATGCかどうかチェック
            boolean preCheckNow = false;
            for(int j = 0;j < 4;j++) {
                if(s[i] == atgc[j]) preCheckNow = true;
            }
            if(preCheckNow) {
                if(checkNow) tmpLength++;
                else {
                    checkNow = true;
                    tmpLength++;
                }
            }
            else {
                if(checkNow) {
                    checkNow = false;
                    length = length < tmpLength ? tmpLength : length;
                    tmpLength = 0;
                }
            }
            
            checkNow = preCheckNow;
        }
        if(checkNow) length = length < tmpLength ? tmpLength : length;
        
        System.out.println(length);
    }
}
