#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
int num[maxn][maxn];
int bad[maxn * maxn];
int main() {
  int n;
  scanf("%d", &n);
  memset(bad, 0, sizeof(bad));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      scanf("%d", &num[i][j]);
      if (num[i][j] == 1)
        bad[i] = 1;
      else if (num[i][j] == 2)
        bad[j] = 1;
      else if (num[i][j] == 3) {
        bad[i] = 1;
        bad[j] = 1;
      }
    }
  }
  int res = 0;
  int flag;
  for (int i = 1; i <= n; i++) {
    if (!bad[i]) {
      res++;
      flag = i;
    }
  }
  cout << res << endl;
  if (res) {
    for (int i = 1; i < flag; i++) {
      if (!bad[i]) printf("%d ", i);
    }
    printf("%d\n", flag);
  }
  return 0;
}
