#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18L + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  cin >> T;
  while (T--) {
    long long int n, i, mx = 0;
    cin >> n;
    string s;
    cin >> s;
    for (i = 0; i < n; i++) {
      if (s[i] == '1') {
        mx = max({mx, n - i, i + 1});
      }
    }
    if (mx == 0)
      cout << n << endl;
    else
      cout << 2 * mx << endl;
  }
}
