#include <bits/stdc++.h>
using namespace std;
int N;
int a[110][110];
int check[110];
int main() {
  scanf("%d", &N);
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      scanf("%d", &a[i][j]);
      if ((a[i][j] == 1 || a[i][j] == 3) && check[i] == 0) {
        cnt++;
        check[i] = 1;
      }
    }
  }
  printf("%d\n", N - cnt);
  for (int i = 0; i < N; i++) {
    if (check[i] == 0) printf("%d ", i + 1);
  }
}
