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