#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int main() {
  int n, cal = 0;
  int car[maxn][maxn];
  int goodcar[maxn];
  memset(goodcar, 0, sizeof(goodcar));
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> car[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (car[i][j] == 1 || car[i][j] == 3) goodcar[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (!goodcar[i]) cal++;
  }
  cout << cal << endl;
  for (int i = 0; i < n; i++) {
    if (!goodcar[i]) cout << i + 1 << " ";
  }
  cout << endl;
  return 0;
}
