#include <bits/stdc++.h>
int main() {
  int car_martrix[100][100];
  int size;
  std::cin >> size;
  bool good_cars[100];
  int num_good_cars = 0;
  for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++) std::cin >> car_martrix[i][j];
  for (int i = 0; i < size; i++) {
    bool good = true;
    good_cars[i] = false;
    for (int j = 0; j < size; j++) {
      if (car_martrix[i][j] == 1 || car_martrix[i][j] == 3) {
        good = false;
        break;
      }
    }
    if (good) {
      good_cars[i] = true;
      num_good_cars++;
    }
  }
  std::cout << num_good_cars << std::endl;
  for (int i = 0; i < size; i++) {
    if (good_cars[i]) {
      std::cout << i + 1 << " ";
    }
  }
  return 0;
}
