#include <bits/stdc++.h>
int main() {
  int q, w, e, r, i, j, t = 0, m = 0, n;
  int a[102][102], b[102];
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (j = 1; j < 102; j++) {
    b[j] = 0;
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (a[i][j] == 1) {
        b[i] = 1;
      }
      if (a[i][j] == 3) {
        b[i] = 1;
      }
    }
  }
  for (j = 1; j <= n; j++) {
    if (b[j] == 0) {
      m++;
    }
  }
  printf("%d\n", m);
  for (i = 1; i <= n; i++) {
    if (b[i] == 0) printf("%d ", i);
  }
  return 0;
}
