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