#include <bits/stdc++.h>
using namespace std;
int n, i, j, x;
bool ok;
vector<int> sol;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    ok = true;
    for (j = 1; j <= n; j++) {
      scanf("%d", &x);
      if (x == 1 || x == 3) ok = false;
    }
    if (ok) sol.push_back(i);
  }
  printf("%d\n", sol.size());
  for (i = 0; i < sol.size(); i++) printf("%d ", sol[i]);
  return 0;
}
