#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 + 5;
char s[MAXN];
int main() {
  int t, n, mid;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    scanf("%s", s + 1);
    mid = 0;
    for (int i = 1; i <= n; i++) {
      if (s[i] == '1') {
        mid = max(i, n - i + 1);
        break;
      }
    }
    for (int i = n; i >= 1; i--) {
      if (s[i] == '1') {
        mid = max(mid, i);
        mid = max(mid, n - i + 1);
        break;
      }
    }
    if (mid == 0)
      printf("%d\n", n);
    else
      printf("%d\n", mid * 2);
  }
  return 0;
}
