#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  ;
  long long a[n][n];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) cin >> a[i][j];
  };
  long long num = n;
  vector<long long> v;
  for (long long i = 0; i < num; i++) {
    v.push_back(1);
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (a[i][j] == 1) {
        v[i] = 0;
      } else if (a[i][j] == 2) {
        v[j] = 0;
      } else if (a[i][j] == 3) {
        v[i] = 0;
        v[j] = 0;
      } else {
        continue;
      }
    }
  }
  long long count = 0;
  for (long long i = 0; i < num; i++) {
    if (v[i] == 1) {
      count++;
    }
  }
  cout << count << "\n";
  for (long long i = 0; i < num; i++) {
    if (v[i] == 1) {
      cout << (i + 1) << " ";
    }
  }
  return 0;
}
