#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int G[107][107];
  cin >> 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) {
    bool ok = true;
    for (int j = 0; j < n; ++j) {
      if (G[i][j] == 1 || G[i][j] == 3) ok = false;
    }
    if (ok) ans.push_back(i + 1);
  }
  cout << ans.size() << "\n";
  for (auto i : ans) cout << i << " ";
  return 0;
}
