#include <bits/stdc++.h>
using namespace std;
bool b[110];
int main() {
  int n;
  cin >> n;
  int a[n][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 (a[i][j] == 1) {
        b[i] = 1;
      }
      if (a[i][j] == 2) {
        b[j] = 1;
      }
      if (a[i][j] == 3) {
        b[j] = b[i] = 1;
      }
    }
  }
  int k = 0;
  for (int i = 0; i < n; i++) {
    if (!b[i]) k++;
  }
  cout << k << endl;
  for (int i = 0; i < n; i++) {
    if (!b[i]) cout << i + 1 << " ";
  }
  return 0;
}
