#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  size_t n;
  std::cin >> n;
  std::vector<size_t> result;
  for (size_t i = 0; i < n; ++i) {
    bool good = true;
    for (size_t j = 0; j < n; ++j) {
      int32_t a;
      std::cin >> a;
      if (a == 1 || a == 3) {
        good = false;
      }
    }
    if (good) {
      result.push_back(i);
    }
  }
  std::cout << result.size() << '\n';
  for (size_t x : result) {
    std::cout << x + 1 << ' ';
  }
  std::cout << '\n';
}
