#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, car[101][101];
  bool t[101] = {0};
  vector<int> ans;
  ans.clear();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &car[i][j]);
      if (car[i][j] == 2) {
        t[j] = true;
      } else if (car[i][j] == 1) {
        t[i] = true;
      } else if (car[i][j] == 3) {
        t[i] = true;
        t[j] = true;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (t[i] == false) ans.push_back(i + 1);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d", ans[i]);
    if (i < ans.size() - 1) printf(" ");
  }
  return 0;
}
