#include <bits/stdc++.h>
using namespace std;
int main() {
  long long tc, n;
  scanf("%lld", &tc);
  string s;
  while (tc--) {
    scanf("%lld", &n);
    cin >> s;
    bool f = 1;
    for (long long i = 0; i < n; i++) {
      if (s[i] == '1') {
        f = 0;
        break;
      }
    }
    if (f) {
      cout << n << endl;
    } else {
      long long ans = 0, t, t1;
      for (long long i = 0; i < n; i++) {
        if (s[i] == '1') {
          t = (i + 1) * 2;
          t1 = i + 1 + (n - i);
          ans = max(ans, max(t, t1));
          t = 2 * (n - i);
          t1 = n;
          ans = max(ans, max(t, t1));
        }
      }
      printf("%lld\n", ans);
    }
  }
}
