#include <bits/stdc++.h>
using namespace std;
const long long nInf = -1000000000;
const long long pInf = 1000000000;
const long long mod = 1000000007;
int main() {
  int a[100][100];
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  bool isgood[100];
  fill(isgood, isgood + 100, false);
  vector<int> good;
  for (int i = 0; i < n; i++) {
    bool isg = true;
    for (int j = 0; j < n; j++) {
      if (i == j || a[i][j] == 0 || a[i][j] == 2) continue;
      isg = false;
    }
    if (isg) good.push_back(i);
  }
  printf("%d\n", (int)good.size());
  for (int i = 0; i < (int)good.size(); i++) {
    printf("%d ", good[i] + 1);
  }
  return 0;
}
