#include <bits/stdc++.h>
using namespace std;
int main() {
  int const N = 105;
  int n, d, res[N], count = 0;
  bool b;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    b = true;
    for (int j = 0; j < n; ++j) {
      cin >> d;
      if (d == 1 || d == 3) b = false;
    }
    if (b) {
      res[count] = i + 1;
      ++count;
    }
  }
  cout << count << endl;
  for (int i = 0; i < count; ++i) {
    cout << res[i] << " ";
  }
  cout << endl;
  return 0;
}
