import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.lang.management.MemoryType;
import java.math.BigInteger;
import java.util.*;


public class Main {
    static final int INF = Integer.MAX_VALUE;

    static int mergeSort(int[] a,int [] c, int begin, int end)
    {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    }


    static int  merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];
        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            }
        return inversion;

    }

    static int []c;
    static int[] v;
    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        }


    }


    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class prog implements Comparable<prog> {

    int skill;
    int indx;
    int pp;

    public prog(int skill, int indx) {
        this.skill = skill;
        this.indx = indx;
        pp = 0;
    }

    @Override
    public String toString() {
        return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}';
    }

    @Override
    public int compareTo(prog o) {
        if (skill!=o.skill)
        return skill-o.skill;
        return-( indx-o.indx);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.lang.management.MemoryType; MemoryType java.lang.management import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {
    static final int INF = Integer.MAX_VALUE;

    static int mergeSort(int[] a,int [] c, int begin, int end)
    {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    }


    static int  merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];
        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            }
        return inversion;

    }

    static int []c;
    static int[] v;
    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        }


    }


    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
} Main static final int INF = Integer.MAX_VALUE; INF Integer.MAX_VALUE Integer Integer.MAX_VALUE static int []c; c static int[] v; v static int mergeSort(int[] a,int [] c, int begin, int end)
    {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    } mergeSort {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    } int inversion=0; inversion 0 if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        } begin < end begin end {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        } inversion=0 inversion 0 int mid = (begin + end) >>1; mid (begin + end) >>1 (begin + end) begin end 1 inversion+= mergeSort(a,c, begin, mid) inversion mergeSort(a,c, begin, mid) mergeSort a c begin mid inversion+=mergeSort(a, c,mid + 1, end) inversion mergeSort(a, c,mid + 1, end) mergeSort a c mid + 1 mid 1 end inversion+=merge(a,c, begin, mid, end) inversion merge(a,c, begin, mid, end) merge a c begin mid end return inversion; inversion int[] a a int [] c c int begin begin int end end static int  merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];
        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            }
        return inversion;

    } merge {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];
        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            }
        return inversion;

    } int n1 = mid - b + 1; n1 mid - b + 1 mid - b mid b 1 int n2 = e - mid; n2 e - mid e mid int[] L = new int[n1+1] L new int[n1+1] n1+1 n1 1 R = new int[n2+1]; R new int[n2+1] n2+1 n2 1 int[] L1 = new int[n1+1] L1 new int[n1+1] n1+1 n1 1 R1 = new int[n2+1]; R1 new int[n2+1] n2+1 n2 1 int inversion=0; inversion 0 for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        } int i = 0; int i = 0; i 0 i < n1 i n1 i++ i++ i {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        } {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        } L[i] = a[b + i] L[i] L i a[b + i] a b + i b i L1[i] = c[b + i] L1[i] L1 i c[b + i] c b + i b i for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        } int i = 0; int i = 0; i 0 i < n2 i n2 i++ i++ i {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        } {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        } R[i] = a[mid + 1 + i] R[i] R i a[mid + 1 + i] a mid + 1 + i mid + 1 + i mid 1 i R1[i] = c[mid + 1 + i] R1[i] R1 i c[mid + 1 + i] c mid + 1 + i mid + 1 + i mid 1 i L[n1] = R[n2] = INF L[n1] L n1 R[n2] = INF R[n2] R n2 INF for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            } int k = b, i = 0, j = 0; int k = b k b i = 0 i 0 j = 0; j 0 k <= e k e k++ k++ k if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            } if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            } L[i] <= R[j] L[i] L i R[j] R j {
                a[k] = L[i];
                c[k] = L1[i++];
            } a[k] = L[i] a[k] a k L[i] L i c[k] = L1[i++] c[k] c k L1[i++] L1 i++ i {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            } a[k] = R[j] a[k] a k R[j] R j c[k] = R1[j++] c[k] c k R1[j++] R1 j++ j inversion=inversion+(n1-i) inversion inversion+(n1-i) inversion (n1-i) n1 i return inversion; inversion int[] a a int[]c c int b b int mid mid int e e static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    } gcd {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    } if (b == 0)
            return a; b == 0 b 0 return a; a return gcd(b, a % b); gcd(b, a % b) gcd b a % b a b long a a long b b public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        }


    } main {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        }


    } Scanner in = new Scanner(System.in); in new Scanner(System.in) try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        } {

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        } PrintWriter or = new PrintWriter(System.out) PrintWriter or = new PrintWriter(System.out) new PrintWriter(System.out) char [] a= in.next().toCharArray(); a in.next().toCharArray() in.next().toCharArray in.next() in.next in int max=0 max 0 ans=0; ans 0 for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            } {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            } if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                } a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C' a[i]=='G' a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C' a[i]=='A' a[i] a i 'A' a[i]=='T' a[i] a i 'T' a[i]=='G' a[i] a i 'G' a[i]=='C' a[i] a i 'C' {
                    ++ans;
                    max= Math.max(max,ans);
                } ++ans ans max= Math.max(max,ans) max Math.max(max,ans) Math.max Math max ans {
                    max= Math.max(max,ans);
                    ans=0;
                } max= Math.max(max,ans) max Math.max(max,ans) Math.max Math max ans ans=0 ans 0 max= Math.max(max,ans) max Math.max(max,ans) Math.max Math max ans or.println(max) or.println or max String[]args args static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    } Scanner StringTokenizer st; st BufferedReader br; br public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        } Scanner {
            br = new BufferedReader(new InputStreamReader(s));
        } br = new BufferedReader(new InputStreamReader(s)) br new BufferedReader(new InputStreamReader(s)) InputStream s s public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
                st = new StringTokenizer(br.readLine());
            } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt() throws IOException {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() throws IOException {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public String nextLine() throws IOException {
            return br.readLine();
        } nextLine {
            return br.readLine();
        } return br.readLine(); br.readLine() br.readLine br public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        } nextDouble {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        } String x = next(); x next() next StringBuilder sb = new StringBuilder("0"); sb new StringBuilder("0") double res = 0 res 0 f = 1; f 1 boolean dec = false dec false neg = false; neg false int start = 0; start 0 if (x.charAt(0) == '-') {
                neg = true;
                start++;
            } x.charAt(0) == '-' x.charAt(0) x.charAt x 0 '-' {
                neg = true;
                start++;
            } neg = true neg true start++ start for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            } int i = start; int i = start; i start i < x.length() i x.length() x.length x i++ i++ i {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            } {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            } if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                } x.charAt(i) == '.' x.charAt(i) x.charAt x i '.' {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } res = Long.parseLong(sb.toString()) res Long.parseLong(sb.toString()) Long.parseLong Long sb.toString() sb.toString sb sb = new StringBuilder("0") sb new StringBuilder("0") dec = true dec true {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                } sb.append(x.charAt(i)) sb.append sb x.charAt(i) x.charAt x i if (dec) {
                        f *= 10;
                    } dec {
                        f *= 10;
                    } f *= 10 f 10 res += Long.parseLong(sb.toString()) / f res Long.parseLong(sb.toString()) / f Long.parseLong(sb.toString()) Long.parseLong Long sb.toString() sb.toString sb f return res * (neg ? -1 : 1); res * (neg ? -1 : 1) res (neg ? -1 : 1) neg -1 1 1 public boolean ready() throws IOException {
            return br.ready();
        } ready {
            return br.ready();
        } return br.ready(); br.ready() br.ready br class prog implements Comparable<prog> {

    int skill;
    int indx;
    int pp;

    public prog(int skill, int indx) {
        this.skill = skill;
        this.indx = indx;
        pp = 0;
    }

    @Override
    public String toString() {
        return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}';
    }

    @Override
    public int compareTo(prog o) {
        if (skill!=o.skill)
        return skill-o.skill;
        return-( indx-o.indx);
    }
} prog int skill; skill int indx; indx int pp; pp public prog(int skill, int indx) {
        this.skill = skill;
        this.indx = indx;
        pp = 0;
    } prog {
        this.skill = skill;
        this.indx = indx;
        pp = 0;
    } this.skill = skill this.skill this this.skill skill this.indx = indx this.indx this this.indx indx pp = 0 pp 0 int skill skill int indx indx @Override
    public String toString() {
        return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}';
    } toString {
        return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}';
    } return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}'; "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}' pp ", pp=" indx ", indx=" skill "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}' "prog{" "skill=" skill ", indx=" indx ", pp=" pp '}' @Override
    public int compareTo(prog o) {
        if (skill!=o.skill)
        return skill-o.skill;
        return-( indx-o.indx);
    } compareTo {
        if (skill!=o.skill)
        return skill-o.skill;
        return-( indx-o.indx);
    } if (skill!=o.skill)
        return skill-o.skill; skill!=o.skill skill o.skill o o.skill return skill-o.skill; skill-o.skill skill o.skill o o.skill return-( indx-o.indx); -( indx-o.indx) ( indx-o.indx) indx o.indx o o.indx prog o o Comparable public class Main {
    static final int INF = Integer.MAX_VALUE;

    static int mergeSort(int[] a,int [] c, int begin, int end)
    {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    }


    static int  merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];
        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            }
        return inversion;

    }

    static int []c;
    static int[] v;
    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        }


    }


    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
} public class Main {
    static final int INF = Integer.MAX_VALUE;

    static int mergeSort(int[] a,int [] c, int begin, int end)
    {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    }


    static int  merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];
        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            }
        return inversion;

    }

    static int []c;
    static int[] v;
    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        }


    }


    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import java.lang.management.MemoryType;
import java.math.BigInteger;
import java.util.*;


public class Main {
    static final int INF = Integer.MAX_VALUE;

    static int mergeSort(int[] a,int [] c, int begin, int end)
    {
        int inversion=0;
        if(begin < end)
        {
            inversion=0;
            int mid = (begin + end) >>1;
            inversion+= mergeSort(a,c, begin, mid);
            inversion+=mergeSort(a, c,mid + 1, end);
            inversion+=merge(a,c, begin, mid, end);
        }
        return inversion;
    }


    static int  merge(int[] a,int[]c, int b, int mid, int e)
    {
        int n1 = mid - b + 1;
        int n2 = e - mid;
        int[] L = new int[n1+1], R = new int[n2+1];
        int[] L1 = new int[n1+1], R1 = new int[n2+1];
        //inversion
        int inversion=0;

        for(int i = 0; i < n1; i++) {
            L[i] = a[b + i];
            L1[i] = c[b + i];
        }
        for(int i = 0; i < n2; i++)  {
            R[i] = a[mid + 1 + i];
            R1[i] = c[mid + 1 + i];
        }
        L[n1] = R[n2] = INF;

        for(int k = b, i = 0, j = 0; k <= e; k++)
            if(L[i] <= R[j]){
                a[k] = L[i];
                c[k] = L1[i++];
            }

            else
            {
                a[k] = R[j];
                c[k] = R1[j++];
                inversion=inversion+(n1-i);

            }
        return inversion;

    }

    static int []c;
    static int[] v;
    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

        public static void main (String[]args) throws IOException {
        Scanner in = new Scanner(System.in);
        try(PrintWriter or = new PrintWriter(System.out)){

       char [] a= in.next().toCharArray();
       int max=0,ans=0;
            for (int i = 0; i < a.length; i++) {
                if (a[i]=='A'||a[i]=='T'||a[i]=='G'||a[i]=='C'){
                    ++ans;
                    max= Math.max(max,ans);
                }else{
                    max= Math.max(max,ans);
                    ans=0;
                }
            }
            max= Math.max(max,ans);
            or.println(max);







        }


    }


    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++) {
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec) {
                        f *= 10;
                    }
                }
            }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }
}

class prog implements Comparable<prog> {

    int skill;
    int indx;
    int pp;

    public prog(int skill, int indx) {
        this.skill = skill;
        this.indx = indx;
        pp = 0;
    }

    @Override
    public String toString() {
        return "prog{" + "skill=" + skill + ", indx=" + indx + ", pp=" + pp + '}';
    }

    @Override
    public int compareTo(prog o) {
        if (skill!=o.skill)
        return skill-o.skill;
        return-( indx-o.indx);
    }
}