import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String buf = " ";
		int N = S.length();
		int ans = 0;
		for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		}
		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();
		String buf = " ";
		int N = S.length();
		int ans = 0;
		for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String buf = " ";
		int N = S.length();
		int ans = 0;
		for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String buf = " ";
		int N = S.length();
		int ans = 0;
		for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		}
		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 String buf = " "; buf " " int N = S.length(); N S.length() S.length S int ans = 0; ans 0 for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		} {
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		} for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			} int j = 0; int j = 0; j 0 j < i + 1 j i + 1 i 1 j++ j++ j {
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			} {
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			} buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0") buf S.substring(j,N - i + j).replaceAll("[AGTC]","0") S.substring(j,N - i + j).replaceAll S.substring(j,N - i + j) S.substring S j N - i + j N - i N i j "[AGTC]" "0" if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				} buf.matches("0*") buf.matches buf "0*" {
					ans = S.substring(j,N - i + j).length();
					break;
				} ans = S.substring(j,N - i + j).length() ans S.substring(j,N - i + j).length() S.substring(j,N - i + j).length S.substring(j,N - i + j) S.substring S j N - i + j N - i N i j break; if(ans != 0){
				break;
			} ans != 0 ans 0 {
				break;
			} break; 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();
		String buf = " ";
		int N = S.length();
		int ans = 0;
		for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		}
		System.out.println(ans);
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String buf = " ";
		int N = S.length();
		int ans = 0;
		for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		}
		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();
		String buf = " ";
		int N = S.length();
		int ans = 0;
		for(int i = 0;i < N;i++){
			for(int j = 0;j < i + 1;j++){
				buf = S.substring(j,N - i + j).replaceAll("[AGTC]","0");
				if(buf.matches("0*")){
					ans = S.substring(j,N - i + j).length();
					break;
				}
			}
			if(ans != 0){
				break;
			}
		}
		System.out.println(ans);
	}
}