#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    bool f;
    f = 0;
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      if (j != i && (x == -1 || x == 1 || x == 3)) f = 1;
    }
    if (!f) a.push_back(i + 1);
  }
  cout << a.size() << endl;
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  return 0;
}
