import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Comparator;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class BATCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.PriorityQueue; PriorityQueue java.util import java.util.Scanner; Scanner java.util import java.util.Comparator; Comparator java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class BATCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) BATCoder solver = new BATCoder(); solver new BATCoder() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class BATCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        }

    } BATCoder public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        } solve {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        } String s = in.next(); s in.next() in.next in PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder()); pq new PriorityQueue<>(Comparator.reverseOrder()) int cnt = 0; cnt 0 for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(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) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            } {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            } if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                } s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T' s.charAt(i) == 'G' s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T' s.charAt(i) == 'A' s.charAt(i) s.charAt s i 'A' s.charAt(i) == 'C' s.charAt(i) s.charAt s i 'C' s.charAt(i) == 'G' s.charAt(i) s.charAt s i 'G' s.charAt(i) == 'T' s.charAt(i) s.charAt s i 'T' {
                    cnt++;
                } cnt++ cnt {
                    pq.add(cnt);
                    cnt = 0;
                } pq.add(cnt) pq.add pq cnt cnt = 0 cnt 0 pq.add(cnt) pq.add pq cnt out.println(pq.poll()) out.println out pq.poll() pq.poll pq int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class BATCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class BATCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Comparator;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class BATCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' || s.charAt(i) == 'C' || s.charAt(i) == 'G' || s.charAt(i) == 'T') {
                    cnt++;
                } else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        }

    }
}

