#include <bits/stdc++.h>
bool bad[105];
int n, m, ar[105];
int main() {
  int i, j, k, x, y;
  while (scanf("%d", &n) != EOF) {
    memset(bad, 0, sizeof(bad));
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        scanf("%d", &x);
        if (x == 1 || x == 3) bad[i] = true;
        if (x == 2 || x == 3) bad[j] = true;
      }
    }
    m = 0;
    for (i = 0; i < n; i++) {
      if (!bad[i]) ar[m++] = i + 1;
    }
    printf("%d\n", m);
    for (i = 0; i < m; i++) printf("%d ", ar[i]);
    puts("");
  }
  return 0;
}
