import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int ans = 0;
    int temp = 0;
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    }
    ans = Math.max(ans, temp);
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int ans = 0;
    int temp = 0;
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    }
    ans = Math.max(ans, temp);
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int ans = 0;
    int temp = 0;
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    }
    ans = Math.max(ans, temp);
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int ans = 0;
    int temp = 0;
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    }
    ans = Math.max(ans, temp);
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc int ans = 0; ans 0 int temp = 0; temp 0 char[] ch = new char[str.length()]; ch new char[str.length()] str.length() str.length str for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    } {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    } ch[i] = str.charAt(i) ch[i] ch i str.charAt(i) str.charAt str i if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      } ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G' ch[i] == 'C' ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G' ch[i] == 'A' ch[i] ch i 'A' ch[i] == 'T' ch[i] ch i 'T' ch[i] == 'C' ch[i] ch i 'C' ch[i] == 'G' ch[i] ch i 'G' {
        temp++;
      } temp++ temp {
        ans = Math.max(ans, temp);
        temp = 0;
      } ans = Math.max(ans, temp) ans Math.max(ans, temp) Math.max Math ans temp temp = 0 temp 0 ans = Math.max(ans, temp) ans Math.max(ans, temp) Math.max Math ans temp System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int ans = 0;
    int temp = 0;
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    }
    ans = Math.max(ans, temp);
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int ans = 0;
    int temp = 0;
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    }
    ans = Math.max(ans, temp);
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int ans = 0;
    int temp = 0;
    char[] ch = new char[str.length()];
    for(int i = 0; i < str.length(); i++) {
      ch[i] = str.charAt(i);
      if(ch[i] == 'A' || ch[i] == 'T' || ch[i] == 'C' || ch[i] == 'G') {
        temp++;
      } else {
        ans = Math.max(ans, temp);
        temp = 0;
      }
    }
    ans = Math.max(ans, temp);
    System.out.println(ans);
  }
}
