#include <bits/stdc++.h>
const int maxn = (int)1e6;
using namespace std;
long long a[1000000];
int main() {
  int n;
  cin >> n;
  int kol = 0;
  for (int i = 0; i < n; i++) {
    bool ok = true;
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      if (x == 3 || x == 1) ok = false;
    }
    if (ok) {
      kol++;
      a[kol] = i + 1;
    }
  }
  cout << kol << endl;
  for (int i = 1; i <= kol; i++) cout << a[i] << " ";
  cout << endl;
}
