import java.util.*;

public class Main {
public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s  = sc.next();

		s = s.replace('A', '#');
		s = s.replace('T', '#');
		s = s.replace('G', '#');
		s = s.replace('C', '#');
		s = s + "?";
		String[] y = s.split("");

		int count = 0;
		int ans = 0;

		for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		}

		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 s  = sc.next();

		s = s.replace('A', '#');
		s = s.replace('T', '#');
		s = s.replace('G', '#');
		s = s.replace('C', '#');
		s = s + "?";
		String[] y = s.split("");

		int count = 0;
		int ans = 0;

		for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		}

		System.out.println(ans);
		
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s  = sc.next();

		s = s.replace('A', '#');
		s = s.replace('T', '#');
		s = s.replace('G', '#');
		s = s.replace('C', '#');
		s = s + "?";
		String[] y = s.split("");

		int count = 0;
		int ans = 0;

		for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		}

		System.out.println(ans);
		
	} main {

		Scanner sc = new Scanner(System.in);

		String s  = sc.next();

		s = s.replace('A', '#');
		s = s.replace('T', '#');
		s = s.replace('G', '#');
		s = s.replace('C', '#');
		s = s + "?";
		String[] y = s.split("");

		int count = 0;
		int ans = 0;

		for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		}

		System.out.println(ans);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s  = sc.next(); s sc.next() sc.next sc s = s.replace('A', '#') s s.replace('A', '#') s.replace s 'A' '#' s = s.replace('T', '#') s s.replace('T', '#') s.replace s 'T' '#' s = s.replace('G', '#') s s.replace('G', '#') s.replace s 'G' '#' s = s.replace('C', '#') s s.replace('C', '#') s.replace s 'C' '#' s = s + "?" s s + "?" s "?" String[] y = s.split(""); y s.split("") s.split s "" int count = 0; count 0 int ans = 0; ans 0 for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		} int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		} {
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		} if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			} y[i].equals("#") y[i].equals y[i] y i "#" {
				count++;
			} count++ count {
				if(ans<count){
					ans=count;
					count = 0;
				}
			} if(ans<count){
					ans=count;
					count = 0;
				} ans<count ans count {
					ans=count;
					count = 0;
				} ans=count ans count count = 0 count 0 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 s  = sc.next();

		s = s.replace('A', '#');
		s = s.replace('T', '#');
		s = s.replace('G', '#');
		s = s.replace('C', '#');
		s = s + "?";
		String[] y = s.split("");

		int count = 0;
		int ans = 0;

		for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		}

		System.out.println(ans);
		
	}
} public class Main {
public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s  = sc.next();

		s = s.replace('A', '#');
		s = s.replace('T', '#');
		s = s.replace('G', '#');
		s = s.replace('C', '#');
		s = s + "?";
		String[] y = s.split("");

		int count = 0;
		int ans = 0;

		for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		}

		System.out.println(ans);
		
	}
} Main
import java.util.*;

public class Main {
public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s  = sc.next();

		s = s.replace('A', '#');
		s = s.replace('T', '#');
		s = s.replace('G', '#');
		s = s.replace('C', '#');
		s = s + "?";
		String[] y = s.split("");

		int count = 0;
		int ans = 0;

		for(int i = 0; i<s.length(); i++){
			if(y[i].equals("#")){
				count++;
			}else{
				if(ans<count){
					ans=count;
					count = 0;
				}
			}
		}

		System.out.println(ans);
		
	}
}
