#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
const int inf = 0x7f7f7f7f;
bool ok[N];
int main() {
  int t, n, m;
  memset(ok, false, sizeof(ok));
  scanf("%d", &t);
  for (int i = 1; i <= t; ++i) {
    for (int j = 1; j <= t; ++j) {
      int x;
      scanf("%d", &x);
      if (x == 1 || x == 3) ok[i] = true;
    }
  }
  int ans = 0;
  for (int i = 1; i <= t; ++i) {
    if (!ok[i]) ans++;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= t; ++i) {
    if (!ok[i]) printf("%d ", i);
  }
  if (ans) puts("");
  return 0;
}
