#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, v[250000 + 5], cnt;
int main() {
  n = read();
  for (int i = 1; i <= (n); i++)
    for (int j = 1; j <= (n); j++) {
      int x = read();
      if (x == 1 || x == 3) v[i]++;
    }
  for (int i = 1; i <= (n); i++)
    if (!v[i]) cnt++;
  cout << cnt << endl;
  int t = 0;
  for (int i = 1; i <= (n); i++)
    if (!v[i]) printf("%d%c", i, ++t == cnt ? '\n' : ' ');
  return 0;
}
