#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool debug = false;
int main() {
  string s;
  int n, ans = 0;
  cin >> n >> s;
  for (int i = 0; i < int(s.size()); i++) {
    if (i != 0 && s[i] == s[i - 1]) break;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
