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