#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3;
long long i, j, k, n, o, p, aux;
bool viz[113];
vector<int> Q;
int main(void) {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
      cin >> aux;
      if (aux == 1) ++viz[i];
      if (aux == 2) ++viz[j];
      if (aux == 3) ++viz[i], ++viz[j];
    }
  int ok = 0;
  for (int i = 1; i <= n; ++i)
    if (!viz[i]) Q.push_back(i);
  if (!Q.size())
    cout << 0;
  else {
    cout << Q.size() << "\n";
    for (i = 0; i < Q.size(); ++i) cout << Q[i] << " ";
  }
  return 0;
}
