#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  memset(a, 1, sizeof a);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      int x;
      cin >> x;
      if (x == 1)
        a[i] = 0;
      else if (x == 2)
        a[j] = 0;
      else if (x == 3) {
        a[i] = 0;
        a[j] = 0;
      }
    }
  }
  vector<int> v;
  for (int k = 0; k < n; ++k) {
    if (a[k]) v.push_back(k + 1);
  }
  cout << v.size() << endl;
  for (int l = 0; l < v.size(); ++l) {
    cout << v[l] << " ";
  }
}
