#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, x = 0, count = 0;
  cin >> n;
  bool arrayval[n];
  bool check = true;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> x;
      if ((x == 1) || (x == 3)) {
        check = false;
      }
    }
    if (check == true) {
      count = count + 1;
      arrayval[i] = 1;
    } else {
      arrayval[i] = 0;
    }
    check = true;
  }
  cout << count << endl;
  for (int y = 0; y < n; y++) {
    if (arrayval[y] == 1) {
      cout << y + 1 << " ";
    }
  }
}
