#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    bool check = 1;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '1') {
        check = 0;
        break;
      }
    }
    if (check) {
      cout << s.length() << endl;
    } else {
      int first = (s.length() - (s.find_first_of('1'))) * 2;
      int last = (s.find_last_of('1') + 1) * 2;
      cout << max(first, last) << endl;
    }
  }
}
