#include <bits/stdc++.h>
using namespace std;
bool A[101] = {};
int main() {
  int n, x, l = 0, a[101][101];
  cin >> 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 || a[i][j] == 3) {
        A[i] = true;
        l++;
        break;
      }
    }
  }
  cout << n - l << endl;
  for (int i = 0; i < n; i++) {
    if (!A[i]) cout << i + 1 << ' ';
  }
  return 0;
}
