#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[200][200];
  set<int> res;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++) {
    bool f = true;
    for (int j = 0; j < n; j++) {
      if (!(a[i][j] == -1 || a[i][j] == 0 || a[i][j] == 2)) f = false;
    }
    if (f) {
      res.insert(i);
    }
  }
  cout << res.size() << endl;
  for (std::set<int>::iterator it = res.begin(); it != res.end(); ++it)
    std::cout << (*it) + 1 << " ";
  return 0;
}
