#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios_base::sync_with_stdio(0);
  while (cin >> n) {
    vector<int> ans;
    for (int i = 0; i < n; ++i) {
      bool safe = 1;
      for (int j = 0, x; j < n; ++j) {
        cin >> x;
        if (x == 1 || x == 3) safe = 0;
      }
      if (safe) ans.push_back(i + 1);
    }
    int sz = ans.size();
    cout << sz << '\n';
    for (int i = 0; i < sz; ++i) cout << ans[i] << ' ';
    cout << '\n';
  }
  return 0;
}
