#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int **m = new int *[n];
  for (int i = 0; i < n; i++) {
    m[i] = new int[n];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> m[i][j];
  }
  int cnt = 0;
  set<int> a;
  for (int i = 0; i < n; i++) {
    bool flag = 1;
    for (int j = 0; j < n; j++) {
      if (m[i][j] == 1 || m[i][j] == 3) {
        flag = 0;
      }
    }
    if (flag) {
      cnt++;
      a.insert(i);
    }
  }
  cout << cnt;
  if (cnt) {
    cout << endl;
    for (set<int>::iterator it = a.begin(); it != a.end(); it++)
      cout << *it + 1 << " ";
  }
  return 0;
}
