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