#include #include #include using namespace atcoder; using namespace std; #define REP(i, m, n) for (int64_t i = (int64_t)(m); i < (int64_t)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int64_t i = (int64_t)(m - 1); i >= (int64_t)(n); i--) #define rrep(i, n) RREP(i, n, 0) #define all(v) v.begin(), v.end() using vi = vector; using vvi = vector; using vb = vector; using vvb = vector; using vc = vector; using vvc = vector; using vs = vector; using vvs = vector; using vd = vector; using vvd = vector; using pii = pair; using tii = tuple; using vp = vector; using vvp = vector; using vt = vector; using vvt = vector; using mint = modint; using vm = vector; using vvm = vector; using mii = map; using pdi = pair; using tdi = tuple; const int64_t INF = 2e18; const vp dxy = {{0, -1}, {-1, 0}, {0, 1}, {1, 0}}; template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } int64_t to_int(char c) { return c - 'A'; } set target = {'A', 'G', 'C', 'T'}; int main() { int64_t n; cin >> n; string s; cin >> s; int64_t ans = n; reverse(all(s)); for (auto c : s) { if (target.count(c)) break; ans--; } cout << ans << endl; }