#include <bits/stdc++.h>
using namespace std;
int n;
int akt;
bool joe[101];
int jok[100];
int x;
int main() {
  x = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    joe[i] = true;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> akt;
      if (akt == 1) {
        joe[i] = false;
      }
      if (akt == 2) {
        joe[j] = false;
      }
      if (akt == 3) {
        joe[i] = false;
        joe[j] = false;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (joe[i]) {
      x++;
      jok[x - 1] = i;
    }
  }
  cout << x << endl;
  for (int i = 0; i < x; i++) {
    cout << jok[i] << " ";
  }
  return 0;
}
