#include <bits/stdc++.h>
int main() {
  int i, j, n, dl[101][101], kq[101], kq1[101], t = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%d", &dl[i][j]);
      if (dl[i][j] == 1) {
        kq[i] = 1;
      }
      if (dl[i][j] == 3) {
        kq[i] = 1;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (kq[i] == 0) {
      t++;
      kq1[t] = i;
    }
  }
  printf("%d\n", t);
  for (i = 1; i <= t; i++) {
    printf("%d ", kq1[i]);
  }
  return 0;
}
