n = int(input()) s = list(input()) ans = 0 for i in range(n): if(s[i] in {"A","G","C","T"}): ans = i+1 print(ans)