#include <bits/stdc++.h>
bool a[150];
int ma[150][150];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        scanf("%d", &ma[i][j]);
      }
    }
    for (int i = 1; i <= 100; i++) a[i] = true;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (ma[i][j] == 1) a[i] = false;
        if (ma[i][j] == 2) a[j] = false;
        if (ma[i][j] == 3) a[i] = a[j] = false;
      }
    }
    int ans = 0;
    for (int i = 1; i <= n; i++)
      if (a[i]) ans++;
    printf("%d\n", ans);
    for (int i = 1; i <= n; i++) {
      if (a[i]) printf("%d%c", i, i == n ? '\n' : ' ');
    }
  }
}
