#include <bits/stdc++.h>
using namespace std;
int n, lic, dl;
bool czy;
vector<int> wyn;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    czy = 1;
    for (int j = 0; j < n; j++) {
      cin >> lic;
      if (lic == 1 || lic == 3) czy = 0;
    }
    if (czy) {
      wyn.push_back(i);
      dl++;
    }
  }
  if (dl == 0) {
    cout << 0;
    return 0;
  }
  cout << dl << endl;
  for (int i = 0; i < dl; i++) {
    cout << wyn[i] << ' ';
  }
  return 0;
}
