#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100010;
const long long mod = 1000000007;
const long long inf = 2000000000;
const long long inf64 = inf * inf;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t, n;
  string str;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> str;
    if (count(str.begin(), str.end(), '1') == 0)
      cout << n << "\n";
    else {
      int res = 0;
      for (int i = 0; i < n; i++)
        if (str[i] == '1') res = max(res, i + 1);
      for (int i = 1; i <= n; i++)
        if (str[n - i] == '1') res = max(res, i);
      cout << 2 * res << "\n";
    }
  }
  return 0;
}
