#include <bits/stdc++.h>
using namespace std;
int vet[110];
int main() {
  int n, numb, total = 0;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      cin >> numb;
      if (numb == 1)
        vet[i] = 1;
      else if (numb == 2)
        vet[j] = 1;
      else if (numb == 3) {
        vet[i] = 1;
        vet[j] = 1;
      }
    }
  for (int i = 1; i <= n; i++) {
    if (!vet[i]) total++;
  }
  cout << total << endl;
  for (int i = 1; i <= n; i++) {
    if (!vet[i]) cout << i << " ";
  }
  cout << endl;
  return 0;
}
