#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, j, sum = 0, flag = 0;
  cin >> n;
  int a[n][n];
  vector<int> v;
  for (int i = 0; i < n; i++) {
    flag = 0;
    for (j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 1 || a[i][j] == 3) {
        flag = 1;
      }
    }
    if (flag == 0) {
      v.push_back(i + 1);
      sum++;
    }
  }
  cout << sum << '\n';
  vector<int>::iterator t;
  for (t = v.begin(); t != v.end(); t++) {
    cout << *t << " ";
  }
  return 0;
}
