#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  vector<int>::iterator it;
  int n;
  scanf("%d", &n);
  int i, j, flag, num;
  for (i = 0; i < n; i++) {
    flag = 1;
    for (j = 0; j < n; j++) {
      cin >> num;
      if (num == 1 || num == 3) flag = 0;
    }
    if (flag == 1) v.push_back(i + 1);
  }
  if (v.size() > 0) {
    cout << v.size() << endl;
    for (it = v.begin(); it != v.end(); ++it) cout << *it << " ";
    cout << endl;
  } else
    cout << "0" << endl;
  return 0;
}
