#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<std::vector<int>> field(n, std::vector<int>(n, 0));
  for (auto &line : field)
    for (auto &e : line) std::cin >> e;
  std::vector<int> answ;
  for (int i = 0; i < n; i++)
    if (std::count(field[i].begin(), field[i].end(), 1) == 0 &&
        std::count(field[i].begin(), field[i].end(), 3) == 0)
      answ.push_back(i + 1);
  std::cout << answ.size() << "\n";
  for (auto e : answ) std::cout << e << " ";
  return 0;
}
