import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        char[] charArray = S.toCharArray();

        List<Integer> counts = new ArrayList<Integer>();
        int cnt = 0;
        for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        }
        Collections.sort(counts, Collections.reverseOrder());
        if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        }
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        char[] charArray = S.toCharArray();

        List<Integer> counts = new ArrayList<Integer>();
        int cnt = 0;
        for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        }
        Collections.sort(counts, Collections.reverseOrder());
        if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        }
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }

} Main private void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        char[] charArray = S.toCharArray();

        List<Integer> counts = new ArrayList<Integer>();
        int cnt = 0;
        for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        }
        Collections.sort(counts, Collections.reverseOrder());
        if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        }
    } solve {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        char[] charArray = S.toCharArray();

        List<Integer> counts = new ArrayList<Integer>();
        int cnt = 0;
        for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        }
        Collections.sort(counts, Collections.reverseOrder());
        if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc char[] charArray = S.toCharArray(); charArray S.toCharArray() S.toCharArray S List<Integer> counts = new ArrayList<Integer>(); counts new ArrayList<Integer>() int cnt = 0; cnt 0 for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        } int i = 0; int i = 0; i 0 i < charArray.length i charArray.length charArray charArray.length i++ i++ i {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        } {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        } if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            } charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T' charArray[i] == 'G' charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T' charArray[i] == 'A' charArray[i] charArray i 'A' charArray[i] == 'C' charArray[i] charArray i 'C' charArray[i] == 'G' charArray[i] charArray i 'G' charArray[i] == 'T' charArray[i] charArray i 'T' {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            } cnt++ cnt if (i == charArray.length -1) {
                    counts.add(cnt);
                } i == charArray.length -1 i charArray.length -1 charArray.length charArray charArray.length 1 {
                    counts.add(cnt);
                } counts.add(cnt) counts.add counts cnt {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            } if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                } cnt != 0 cnt 0 {
                    counts.add(cnt);
                    cnt = 0;
                } counts.add(cnt) counts.add counts cnt cnt = 0 cnt 0 Collections.sort(counts, Collections.reverseOrder()) Collections.sort Collections counts Collections.reverseOrder() Collections.reverseOrder Collections if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        } counts.size() == 0 counts.size() counts.size counts 0 {
            System.out.print(0);
        } System.out.print(0) System.out.print System.out System System.out 0 {
            System.out.print(counts.get(0));
        } System.out.print(counts.get(0)) System.out.print System.out System System.out counts.get(0) counts.get counts 0 // Main
    public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        char[] charArray = S.toCharArray();

        List<Integer> counts = new ArrayList<Integer>();
        int cnt = 0;
        for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        }
        Collections.sort(counts, Collections.reverseOrder());
        if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        }
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }

} public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        char[] charArray = S.toCharArray();

        List<Integer> counts = new ArrayList<Integer>();
        int cnt = 0;
        for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        }
        Collections.sort(counts, Collections.reverseOrder());
        if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        }
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        char[] charArray = S.toCharArray();

        List<Integer> counts = new ArrayList<Integer>();
        int cnt = 0;
        for (int i = 0; i < charArray.length; i++) {
            if (charArray[i] == 'A' || charArray[i] == 'C' || charArray[i] == 'G' || charArray[i] == 'T') {
                cnt++;
                if (i == charArray.length -1) {
                    counts.add(cnt);
                }
            }
            else {
                if (cnt != 0) {
                    counts.add(cnt);
                    cnt = 0;
                }
            }
        }
        Collections.sort(counts, Collections.reverseOrder());
        if (counts.size() == 0) {
            System.out.print(0);
        }
        else {
            System.out.print(counts.get(0));
        }
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }

}
