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