#include <bits/stdc++.h>
int main() {
  int n, i, j, c;
  int a[1000][1000];
  int b[10000];
  c = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) scanf("%d", &a[i][j]);
  for (i = 1; i <= n; i++) {
    int flag = 0;
    for (j = 1; j <= n; j++) {
      if (a[i][j] == 3 || a[i][j] == 1) flag = 1;
    }
    if (flag == 0) {
      b[c] = i;
      c++;
    }
  }
  printf("%d\n", c);
  if (c != 0) {
    for (i = 0; i < c; i++) printf("%d ", b[i]);
    printf("\n");
  }
  return 0;
}
