#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100][100];
  cin >> n;
  vector<int> V;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> a[i][j];
  }
  for (int i = 0; i < n; i++) {
    bool f = true;
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) {
        f = false;
        break;
      }
    }
    if (f) V.push_back(i + 1);
  }
  if (V.size() == 0)
    cout << 0;
  else {
    cout << V.size() << "\n";
    for (int i = 0; i < V.size(); i++) cout << V[i] << " ";
  }
  return 0;
}
