#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, check, sum = 0, a[101][101];
  set<int> s;
  set<int>::iterator it;
  cin >> n;
  for (i = 0; i < n; i++) {
    check = 0;
    for (j = 0; j < n; j++) {
      cin >> a[i][j];
      if (i != j) {
        if (a[i][j] == 1 || a[i][j] == 3) {
          check = 1;
        }
      }
    }
    if (check == 0) {
      sum++;
      s.insert(i + 1);
    }
  }
  cout << sum << "\n";
  for (it = s.begin(); it != s.end(); it++) {
    cout << *it << " ";
  }
  return 0;
}
