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