#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, k = 0;
  cin >> n;
  int mas[105][105], A[105];
  for (int i = 0; i < n; i++) {
    int c = 0;
    for (int j = 0; j < n; j++) {
      cin >> mas[i][j];
      if (mas[i][j] == 1 || mas[i][j] == 3) {
        c++;
      }
    }
    if (c == 0) {
      A[k] = i + 1;
      k++;
    }
  }
  cout << k << "\n";
  for (int i = 0; i < k; i++) {
    cout << A[i] << " ";
  }
  return 0;
}
