import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.next().split("");
        int length = str.length;
        HashSet<String> set = new HashSet<>();
        HashMap<String, String> map = new HashMap<>();
        map.put("A", "A");
        map.put("C", "C");
        map.put("G", "G");
        map.put("T", "T");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        }
        int max = 0;
        for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        }
        System.out.println(max);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.next().split("");
        int length = str.length;
        HashSet<String> set = new HashSet<>();
        HashMap<String, String> map = new HashMap<>();
        map.put("A", "A");
        map.put("C", "C");
        map.put("G", "G");
        map.put("T", "T");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        }
        int max = 0;
        for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        }
        System.out.println(max);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.next().split("");
        int length = str.length;
        HashSet<String> set = new HashSet<>();
        HashMap<String, String> map = new HashMap<>();
        map.put("A", "A");
        map.put("C", "C");
        map.put("G", "G");
        map.put("T", "T");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        }
        int max = 0;
        for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        }
        System.out.println(max);
    } main {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.next().split("");
        int length = str.length;
        HashSet<String> set = new HashSet<>();
        HashMap<String, String> map = new HashMap<>();
        map.put("A", "A");
        map.put("C", "C");
        map.put("G", "G");
        map.put("T", "T");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        }
        int max = 0;
        for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        }
        System.out.println(max);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] str = sc.next().split(""); str sc.next().split("") sc.next().split sc.next() sc.next sc "" int length = str.length; length str.length str str.length HashSet<String> set = new HashSet<>(); set new HashSet<>() HashMap<String, String> map = new HashMap<>(); map new HashMap<>() map.put("A", "A") map.put map "A" "A" map.put("C", "C") map.put map "C" "C" map.put("G", "G") map.put map "G" "G" map.put("T", "T") map.put map "T" "T" StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        } int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        } {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        } if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            } map.containsValue(str[i]) map.containsValue map str[i] str i {
                sb.append(str[i]);
            } sb.append(str[i]) sb.append sb str[i] str i {
                set.add(sb.toString());
                sb.setLength(0);
            } set.add(sb.toString()) set.add set sb.toString() sb.toString sb sb.setLength(0) sb.setLength sb 0 if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            } i == length -1 i length -1 length 1 {
                set.add(sb.toString());
                sb.setLength(0);
            } set.add(sb.toString()) set.add set sb.toString() sb.toString sb sb.setLength(0) sb.setLength sb 0 int max = 0; max 0 for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        } String tmp set {
            if (max < tmp.length()) max = tmp.length();
        } {
            if (max < tmp.length()) max = tmp.length();
        } if (max < tmp.length()) max = tmp.length(); max < tmp.length() max tmp.length() tmp.length tmp max = tmp.length() max tmp.length() tmp.length tmp 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) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.next().split("");
        int length = str.length;
        HashSet<String> set = new HashSet<>();
        HashMap<String, String> map = new HashMap<>();
        map.put("A", "A");
        map.put("C", "C");
        map.put("G", "G");
        map.put("T", "T");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        }
        int max = 0;
        for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        }
        System.out.println(max);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.next().split("");
        int length = str.length;
        HashSet<String> set = new HashSet<>();
        HashMap<String, String> map = new HashMap<>();
        map.put("A", "A");
        map.put("C", "C");
        map.put("G", "G");
        map.put("T", "T");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        }
        int max = 0;
        for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        }
        System.out.println(max);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.next().split("");
        int length = str.length;
        HashSet<String> set = new HashSet<>();
        HashMap<String, String> map = new HashMap<>();
        map.put("A", "A");
        map.put("C", "C");
        map.put("G", "G");
        map.put("T", "T");
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            if (map.containsValue(str[i])) {
                sb.append(str[i]);
            } else {
                set.add(sb.toString());
                sb.setLength(0);
            }
            if (i == length -1) {
                set.add(sb.toString());
                sb.setLength(0);
            }
        }
        int max = 0;
        for (String tmp : set) {
            if (max < tmp.length()) max = tmp.length();
        }
        System.out.println(max);
    }
}