#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1000000007;
long long int inf = 1e15;
void scan(int &x);
long long int powermod(long long int _a, long long int _b, long long int _m) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long long int string_to_number(string s) {
  long long int x = 0;
  stringstream convert(s);
  convert >> x;
  return x;
}
long long int add(long long int a, long long int b) {
  long long int x = (a + b) % MOD;
  return x;
}
long long int mul(long long int a, long long int b) {
  long long int x = (a * b) % MOD;
  return x;
}
long long int sub(long long int a, long long int b) {
  long long int x = (a - b + MOD) % MOD;
  return x;
}
long long int divi(long long int a, long long int b) {
  long long int x = a;
  long long int y = powermod(b, MOD - 2, MOD);
  long long int res = (x * y) % MOD;
  return res;
}
vector<int> vec[100005];
bool vis[100005];
int cnt_edges = 0;
vector<int> keep;
void dfs(int x) {
  vis[x] = true;
  keep.push_back(x);
  for (int node : vec[x]) {
    cnt_edges++;
    if (!vis[node]) {
      dfs(node);
    }
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int left = -1, right = -1;
    int flag = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '1') {
        if (flag == 0) {
          left = i;
          right = i;
          flag = 1;
        } else
          right = i;
      }
    }
    int ans = INT_MIN;
    if (left != -1) {
      ans = max(n + 1, max(2 * (right + 1), 2 * (n - left)));
      cout << ans;
    } else {
      cout << n;
    }
    cout << "\n";
  }
  return 0;
}
void scan(int &x) {
  register int c = getchar();
  x = 0;
  int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
