#include <bits/stdc++.h>
using namespace std;
int i, j, k, m, n, u, t;
string s, s2;
struct bs {
  int poz;
  char c;
};
string sol[100];
bool cmp(bs o1, bs o2) { return o1.c < o2.c; }
int a[102][102];
bool viz[1000];
int main() {
  cin >> n;
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j) cin >> a[i][j];
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j) {
      if (a[i][j] == 1) viz[i] = 1;
      if (a[i][j] == 2) viz[j] = 1;
      if (a[i][j] == 3) {
        viz[j] = 1;
        viz[i] = 1;
      }
    }
  int ok = 0;
  for (i = 1; i <= n; ++i)
    if (!viz[i]) ++ok;
  cout << ok << "\n";
  if (ok)
    for (i = 1; i <= n; ++i)
      if (!viz[i]) cout << i << " ";
  return 0;
}
