#include <bits/stdc++.h>
using namespace std;
int a[101][101];
vector<int> v;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    bool ok = true;
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 1 || a[i][j] == 3) {
        ok = false;
      }
    }
    if (ok) v.push_back(i);
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
}
