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