#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[200][200], l = 0, t, b[10000], sum = 0;
  cin >> n;
  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++) {
    sum = 0;
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) {
        sum = n + 1;
        break;
      }
      if (a[i][j] == 0) sum++;
    }
    if (sum <= n - 1) b[l++] = i + 1;
  }
  for (int i = 0; i < l; i++)
    for (int j = i + 1; j < l; j++) {
      if (b[j] < b[i]) {
        t = b[j];
        b[j] = b[i];
        b[i] = t;
      }
    }
  cout << l << endl;
  if (l != 0) {
    for (int i = 0; i < l; i++) cout << b[i] << " ";
  }
  return 0;
}
