#include <bits/stdc++.h>
using namespace std;
const int m = 100 + 100;
int a[m], b[m];
int main() {
  int n, x = 0, y;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> y;
      if (y == 1)
        a[i]++;
      else if (y == 2)
        a[j]++;
      else if (y == 3) {
        a[i]++;
        a[j]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      b[x] = i;
      x++;
    }
  }
  cout << x << endl;
  for (int i = 0; i < x; i++) cout << b[i] << " ";
}
