#include <bits/stdc++.h>
using namespace std;
bool exitInput = false;
int ntest = 1, itest = 1;
const char* directions[4] = {"NE", "SE", "SW", "NW"};
const long long Mod = 3210121;
const int maxn = 200 + 5;
const int maxv = 40000 + 5;
const int maxe = 200000 + 5;
const int root = 1;
int n, a[maxn][maxn];
int main() {
  int i, j, k;
  scanf("%d", &n);
  vector<int> res;
  bool good;
  for (i = 1; i <= n; ++i) {
    good = true;
    for (j = 1; j <= n; ++j) {
      scanf("%d", &k);
      if (k == 3 || k == 1) good = false;
    }
    if (good) res.push_back(i);
  }
  printf("%d\n", res.size());
  for (i = 0; i < res.size(); ++i) {
    printf("%d ", res[i]);
  }
  return 0;
}
