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