D = {"A","G","C","T"} N = int(input()) S = "0"+input().strip() ans = 0 for i in range(1,N+1): if S[i] in D: ans = i print(ans)