#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int mat[500][500];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
    }
  }
  bool visited[500];
  memset(visited, false, sizeof(visited));
  vector<int> v;
  int brojac = 0;
  for (int i = 0; i < n; i++) {
    int brojac1 = 0;
    for (int j = 0; j < n; j++) {
      if (mat[i][j] == 1) {
        brojac1++;
      }
      if (mat[i][j] == 3) {
        brojac1++;
      }
    }
    if (brojac1 == 0) {
      brojac++;
      v.push_back(i + 1);
    }
  }
  if (brojac == 0) {
    cout << brojac << endl;
    return 0;
  }
  cout << brojac << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
  return 0;
}
