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