#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int **a = new int *[n];
  for (int i(0); i < n; i++) {
    a[i] = new int[n];
  }
  for (int i(0); i < n; i++) {
    for (int j(0); j < n; j++) {
      cin >> a[i][j];
    }
  }
  int *b = new int[n];
  for (int i(0); i < n; i++) {
    b[i] = -2;
  }
  int s = 0;
  for (int i(0); i < n; i++) {
    for (int j(0); j < n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) {
        break;
      }
      if (j == n - 1) {
        b[s] = i;
        s++;
      }
    }
  }
  cout << s << endl;
  for (int i(0); i < n; i++) {
    if (b[i] != -2) cout << (b[i] + 1) << " ";
  }
  return 0;
}
