#include <bits/stdc++.h>
using namespace std;
int ans[110][110];
int res[110];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) scanf("%d", &ans[i][j]);
  }
  int t = 0;
  for (int i = 1; i <= n; ++i) {
    bool is_good = true;
    for (int j = 1; j <= n; ++j) {
      if (ans[i][j] == 1 || ans[i][j] == 3) {
        is_good = false;
        break;
      }
    }
    if (is_good) {
      res[t++] = i;
    }
  }
  if (t) {
    printf("%d\n%d", t, res[0]);
    for (int i = 1; i < t; ++i) printf(" %d", res[i]);
  } else
    printf("0");
  printf("\n");
  return 0;
}
