#include <bits/stdc++.h>
using namespace std;
long long n, i, j, x;
bool yes = true;
vector<long long> myv;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    yes = true;
    for (j = 0; j < n; j++) {
      cin >> x;
      if (x == 1 || x == 3) yes = false;
    }
    if (yes) myv.push_back(i + 1);
  }
  cout << myv.size() << endl;
  for (i = 0; i < myv.size(); i++) cout << myv[i] << " ";
  cout << endl;
  return 0;
}
