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