#include <bits/stdc++.h>
int main() {
  int n, t, i, j, count = 0;
  ;
  int a[1004];
  scanf("%d", &n);
  for (i = 0; i < n; i++) a[i] = 0;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      scanf("%d ", &t);
      if (t == 1) {
        a[i]++;
      } else if (t == 3) {
        a[i]++;
        a[j]++;
      }
    }
  for (i = 0; i < n; i++) {
    if (a[i] == 0) count++;
  }
  printf("%d\n", count);
  for (i = 0; i < n; i++) {
    if (a[i] == 0) printf("%d ", i + 1);
  }
}
