#include <bits/stdc++.h>
using namespace std;
int a[107][107];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  bool b;
  vector<int> v;
  for (int i = 1; i <= n; i++) {
    b = true;
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) b = false;
    }
    if (b) v.push_back(i);
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
  return 0;
}
