#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    vector<int> ret;
    for (int i = 1; i <= n; i++) {
      bool ok = true;
      for (int j = 1; j <= n; j++) {
        int a;
        cin >> a;
        if (i == j) continue;
        if (a == 1 || a == 3) ok = false;
      }
      if (ok) ret.push_back(i);
    }
    cout << ret.size() << endl;
    if (ret.size()) {
      for (int i = 0; i < ret.size(); i++) cout << ret[i] << " ";
      cout << endl;
    }
  }
}
