#include <bits/stdc++.h>
int main() {
  int n, i, j, m = 0, k = 0, p;
  int arr[103][103], arr2[103];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    p = 1;
    for (j = 0; j < n; j++) {
      scanf("%d", &arr[i][j]);
      if (arr[i][j] == 1 || arr[i][j] == 3) {
        p = 0;
      }
    }
    if (p == 1) {
      k++;
      arr2[m] = i + 1;
      m++;
    }
  }
  if (k == 0) {
    printf("0\n");
  } else {
    printf("%d\n", k);
    for (i = 0; i < m; i++) {
      printf("%d", arr2[i]);
      if (i != m - 1) printf(" ");
    }
    printf("\n");
  }
  return 0;
}
