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