#include <bits/stdc++.h>
int main() {
  long int a[110][110], b[110] = {0}, c = 0, i, j, n;
  scanf("%ld", &n);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      scanf("%ld", &a[i][j]);
      if (a[i][j] == 1)
        b[i] = 1;
      else if (a[i][j] == 2)
        b[j] = 1;
      else if (a[i][j] == 3) {
        b[i] = 1;
        b[j] = 1;
      }
    }
  for (i = 1; i <= n; i++)
    if (b[i] == 0) c++;
  if (c == 0)
    printf("%ld", c);
  else {
    printf("%ld\n", c);
    for (i = 1; i <= n; i++)
      if (b[i] == 0 && c > 1) {
        c--;
        printf("%ld ", i);
      } else if (b[i] == 0) {
        printf("%ld", i);
        break;
      }
  }
  return 0;
}
