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