#include <bits/stdc++.h>
using namespace std;
int ar[101][101], mark[101];
int main() {
  int n, ct = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &ar[i][j]);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (ar[i][j] == 1)
        mark[i] = 1;
      else if (ar[i][j] == 2)
        mark[j] = 1;
      else if (ar[i][j] == 3)
        mark[i] = 1, mark[j] = 1;
    }
  }
  for (int i = 0; i < n; i++)
    if (!mark[i]) ct++;
  printf("%d\n", ct);
  for (int i = 0; i < n; i++)
    if (!mark[i]) printf("%d ", i + 1);
  printf("\n");
  return 0;
}
