#include <bits/stdc++.h>
using namespace std;
bool KTMangConst(vector<int> a) {
  for (int i = 0; i < a.size() - 1; i++) {
    if (a[i] != a[i + 1]) return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<vector<int> > a;
  vector<int> dem(n, 0);
  a.resize(n);
  for (int i = 0; i < n; i++) {
    a[i].resize(n);
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 1) dem[i]++;
      if (a[i][j] == 2) dem[j]++;
      if (a[i][j] == 3) {
        dem[i]++;
        dem[j]++;
      }
    }
  int cargood = 0;
  int min = dem[0];
  for (int i = 0; i < n; i++)
    if (dem[i] == 0) cargood++;
  cout << cargood << endl;
  for (int i = 0; i < n; i++)
    if (dem[i] == 0) cout << i + 1 << " ";
}
