#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int sum = 0;
  int d[101] = {0};
  int a[101][101] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j > i) {
        if (a[i][j] == 1) {
          d[i] = 1;
        }
        if (a[i][j] == 2) {
          d[j] = 1;
        }
        if (a[i][j] == 3) {
          d[i] = 1;
          d[j] = 1;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (d[i] == 0) sum++;
  }
  cout << sum << endl;
  for (int i = 0; i < n; i++) {
    if (d[i] == 0) cout << i + 1 << " ";
  }
  return 0;
}
