#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int dir_r[] = {1, 0, -1, 0, -1, 1, -1, 1};
int dir_c[] = {0, 1, 0, -1, -1, 1, 1, -1};
int main(void) {
  int n, temp, res = 0;
  cin >> n;
  vector<int> v(n + 1, 1);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &temp);
      if (temp == 1) {
        v[i + 1] = 0;
      } else if (temp == 2) {
        v[j + 1] = 0;
      } else if (temp == 3) {
        v[i + 1] = 0, v[j + 1] = 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (v[i]) {
      res++;
    }
  }
  cout << res << endl;
  for (int i = 1; i < ((int)((v).size())); i++) {
    if (v[i]) {
      cout << i << " ";
    }
  }
  return 0;
}
