#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > g(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> g[i][j];
  }
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (g[i][j] == 1 || g[i][j] == 3) {
        goto next;
      }
    }
    ans.push_back(i + 1);
  next:;
  }
  cout << ans.size() << endl;
  if (ans.size() > 0) {
    cout << ans[0];
    for (int i = 1; i < ans.size(); i++) cout << " " << ans[i];
  }
  return 0;
}
