#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<bool> good(n, 1);
  for (int row = 0; row < n; row++) {
    for (int col = 0; col < n; col++) {
      int temp;
      cin >> temp;
      if (temp == 1 || temp == 3) {
        good[row] = 0;
      }
    }
    scanf("\n");
  }
  int total = 0;
  for (int p = 0; p < n; p++) {
    if (good[p]) {
      ++total;
    }
  }
  cout << total << endl;
  for (int p = 0; p < n; p++) {
    if (good[p]) {
      cout << p + 1 << " ";
    }
  }
  return 0;
}
