#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0;
  int a;
  int b[101] = {0};
  vector<int> v;
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      scanf("%d", &a);
      if (a == 1)
        b[i] = 1;
      else if (a == 2)
        b[j] = 1;
      else if (a == 3) {
        b[i] = b[j] = 1;
      }
    }
  for (int i = 0; i < n; i++)
    if (b[i] == 0) {
      c++;
      v.push_back(i + 1);
    }
  printf("%d\n", c);
  for (vector<int>::iterator it = v.begin(); it != v.end(); it++)
    printf("%d ", *it);
  return 0;
}
