#include <bits/stdc++.h>
using namespace std;
int vis[1009];
int ma[1009][1009];
int main() {
  int N;
  scanf("%d", &N);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      scanf("%d", &ma[i][j]);
    }
  }
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      if (i != j) {
        if (ma[i][j] == 1) {
          vis[i] = 1;
        }
        if (ma[i][j] == 2) {
          vis[j] = 1;
        }
        if (ma[i][j] == 3) {
          vis[i] = vis[j] = 1;
        }
      }
    }
  }
  int sum = 0;
  for (int i = 1; i <= N; i++) {
    if (!vis[i]) sum++;
  }
  printf("%d\n", sum);
  int flag = 0;
  for (int i = 1; i <= N; i++) {
    if (!vis[i]) {
      if (flag) printf(" ");
      printf("%d", i);
      flag = 1;
    }
  }
  puts("");
  return 0;
}
