import sys if sys.platform =='ios': import clipboard a=clipboard.get() a = a.split('\n') text = '\n'.join(a) with open('input_file.txt','w') as f: f.write(text) sys.stdin = open('input_file.txt') n = int(input()) s = input() cnt = 0 A = ["A","G","C","T"] for i in range(n-1,-1,-1): if s[i] in A: print(i+1) exit() print(0)