#include <bits/stdc++.h>
using namespace std;
const int N = 100500;
int b[N];
int main() {
  srand(time(NULL));
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      int x;
      cin >> x;
      if (x == 1 || x == 3) b[i] = 1;
    }
  }
  int kol = 0;
  for (int i = 1; i <= n; i++)
    if (b[i] == 0) {
      kol++;
    }
  cout << kol << endl;
  for (int i = 1; i <= n; i++)
    if (b[i] == 0) {
      cout << i << " ";
    }
  return 0;
}
