#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> good;
  for (int i = 0; i < n; i++) {
    int k0 = 0;
    for (int j = 0; j < n; j++) {
      int a;
      scanf("%d", &a);
      if (a == 0 || a == 2) k0++;
    }
    if (k0 == n - 1) good.push_back(i);
  }
  printf("%d\n", good.size());
  for (int i = 0; i < good.size(); i++) printf("%d ", good[i] + 1);
  return 0;
}
