#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int numGood = 0;
  vector<int> goods;
  for (int i = 0; i < n; i++) {
    bool good = true;
    for (int j = 0; j < n; j++) {
      int a;
      cin >> a;
      if (i != j && a == 3 || a == 1) good = false;
    }
    if (good) {
      numGood++;
      goods.push_back(i + 1);
    }
  }
  cout << numGood << endl;
  for (int i = 0; i < goods.size(); i++) cout << goods[i] << " ";
  return 0;
}
