#include <bits/stdc++.h>
using namespace std;
void fast_in_out() {
  std::ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast_in_out();
  int n, x[101][101], y[101];
  double nn;
  int c = 0;
  cin >> n;
  nn = n;
  for (int i = 0; i < n; i++) {
    int m = 0;
    for (int j = 0; j < n; j++) {
      cin >> x[i][j];
      if (x[i][j] == 1) {
        y[c] = i + 1;
        c++;
        m = 1;
      }
      if (x[i][j] == 3) {
        y[c] = i + 1;
        c++;
        y[c] = j + 1;
        m = 1;
      }
    }
    if (m == 1) nn--;
  }
  cout << nn << endl;
  int k = 0;
  for (int(i) = 1; (i) <= (n); ++(i)) {
    int m = 0;
    for (int(j) = 0; (j) < (c); ++(j)) {
      if (i == y[j]) {
        m = 1;
        break;
      }
    }
    if (m == 0 && k == 0) {
      cout << i;
      k = 1;
    } else if (m == 0 && k == 1)
      cout << " " << i;
  }
  if (k == 1) cout << endl;
  return 0;
}
