#include <bits/stdc++.h>
int a[105][105], b[105];
int main(void) {
  int i, j, n, m, k;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    k = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (a[i][j] == 3 || a[i][j] == 1) break;
      }
      if (j == n) b[k++] = i;
    }
    printf("%d\n", k);
    if (k) printf("%d", b[0] + 1);
    for (i = 1; i < k; i++) {
      printf(" %d", b[i] + 1);
    }
    printf("\n");
  }
}
