#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n;
vector<pair<int, int> > ans;
int f[maxn], g[maxn], a[maxn], b[maxn];
int n1 = 0, n2 = 0;
int main() {
  cin >> n;
  memset(f, 127, sizeof(f));
  memset(g, 127, sizeof(g));
  for (int i = 1; i <= n; i++) {
    int t = 0;
    scanf("%d", &t);
    if (t & 1)
      f[++n1] = i;
    else
      g[++n2] = i;
    a[i] = n1;
    b[i] = n2;
  }
  for (int t = 1; t <= n; t++) {
    bool flag = 0;
    int cur1 = 0, cur2 = 0;
    int s1 = 0, s2 = 0;
    for (int cur = 0; cur <= n;) {
      int x = 0, y = 0;
      if (cur1 + t > n1 && cur2 + t > n2) {
        flag = 1;
        break;
      }
      x = f[cur1 + t];
      y = g[cur2 + t];
      int now = min(x, y);
      if (x < y)
        s1++;
      else
        s2++;
      cur1 = a[now], cur2 = b[now];
      if (now == n) {
        if (x > y && s1 > s2) flag = 1;
        if (x < y && s1 < s2) flag = 1;
        if (s1 == s2) flag = 1;
        break;
      }
      cur = now;
    }
    if (!flag) ans.push_back(make_pair(max(s1, s2), t));
  }
  sort((ans).begin(), (ans).end());
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
