#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> result;
  int n;
  cin >> n;
  int arr[n][n];
  for (int i = 0; i < n; i++) {
    for (int y = 0; y < n; y++) {
      cin >> arr[i][y];
    }
  }
  int counter = 0;
  for (int i = 0; i < n; i++) {
    counter = 0;
    for (int z = 0; z < n; z++) {
      if (arr[i][z] == 1 || arr[i][z] == 3) {
        counter++;
      }
    }
    if (counter == 0) {
      result.push_back(i + 1);
    }
  }
  cout << result.size() << endl;
  if (result.size() == 0) {
    return 0;
  } else {
    sort(result.begin(), result.end());
    for (int i = 0; i < result.size(); i++) {
      if (i == result.size() - 1) {
        cout << result[i];
      } else
        cout << result[i] << " ";
    }
  }
  return 0;
}
