import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
	String sa[] = sc.next().split("");
    int count = 0;
    int max = 0;
    for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    }
    System.out.println(max);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
	String sa[] = sc.next().split("");
    int count = 0;
    int max = 0;
    for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    }
    System.out.println(max);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
	String sa[] = sc.next().split("");
    int count = 0;
    int max = 0;
    for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    }
    System.out.println(max);
  } main {
    Scanner sc = new Scanner(System.in);
    
	String sa[] = sc.next().split("");
    int count = 0;
    int max = 0;
    for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    }
    System.out.println(max);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String sa[] = sc.next().split(""); sa sc.next().split("") sc.next().split sc.next() sc.next sc "" int count = 0; count 0 int max = 0; max 0 for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    } String s sa {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    } {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    } if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       } "ACGT".indexOf(s) != -1 "ACGT".indexOf(s) "ACGT".indexOf "ACGT" s -1 1 {
         count++;
       } count++ count {
         count = 0; 
       } count = 0 count 0 if (count >= max) { 
         max = count;
       } count >= max count max { 
         max = count;
       } max = count max count 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){
    Scanner sc = new Scanner(System.in);
    
	String sa[] = sc.next().split("");
    int count = 0;
    int max = 0;
    for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    }
    System.out.println(max);
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
	String sa[] = sc.next().split("");
    int count = 0;
    int max = 0;
    for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    }
    System.out.println(max);
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
	String sa[] = sc.next().split("");
    int count = 0;
    int max = 0;
    for (String s : sa) {
       if ("ACGT".indexOf(s) != -1) {
         count++;
       } else {
         count = 0; 
       }
       if (count >= max) { 
         max = count;
       }
    }
    System.out.println(max);
  }
}