#include <bits/stdc++.h>
using namespace std;
void init() {
  int n;
  string a;
  cin >> n >> a;
  int ans = n;
  for (int i = 0; i < n; ++i)
    if (a[i] == '1') {
      ans = max(ans, 2 * max(i + 1, n - i));
    }
  cout << ans << endl;
}
void work() {}
int main() {
  int t;
  cin >> t;
  while (t--) {
    init();
    work();
  }
  return 0;
}
