/* -*- coding: utf-8 -*- * * 1943.cc: No.1943 消えたAGCT(1) - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 500000; /* typedef */ /* global variables */ bool cmap[128]; char s[MAX_N + 4]; /* subroutines */ /* main */ int main() { cmap['A'] = cmap['G'] = cmap['C'] = cmap['T'] = true; int n; scanf("%d%s", &n, s); int k = n - 1; while (k >= 0 && ! cmap[s[k]]) k--; printf("%d\n", k + 1); return 0; }