#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, m = 0;
  bool b = 0;
  cin >> n;
  vector<vector<int>> v(n);
  vector<int> q;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> m;
      v[i].push_back(m);
      if (v[i][j] == 1 || v[i][j] == 3 && b == 0) {
        b = 1;
      }
    }
    switch (b) {
      case 0:
        q.push_back(i + 1);
        break;
      default:
        b = 0;
    }
  }
  cout << q.size() << endl;
  for (int i = 0; i < q.size(); i++) cout << q[i] << " ";
}
