import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); String[] strAry = (sc.next()).split(""); boolean flag = false; int i = strAry.length - 1; for ( ; -1 < i ; i--) { switch(strAry[i]) { case "A": case "G": case "C": case "T": flag = true; break; } if (flag) { break; } } System.out.println(i + 1); sc.close(); } }