#include <bits/stdc++.h>
using namespace std;
queue<int> q;
bool ans[110];
int main() {
  int n;
  scanf("%d", &n);
  memset(ans, true, sizeof(ans));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int tmp;
      scanf("%d", &tmp);
      if (j > i) {
        if (tmp == 1)
          ans[i] = false;
        else if (tmp == 2)
          ans[j] = false;
        else if (tmp == 3) {
          ans[i] = false;
          ans[j] = false;
        }
      }
    }
  }
  int sum = 0;
  for (int i = 0; i < n; i++)
    if (ans[i]) {
      sum++;
      q.push(i + 1);
    }
  printf("%d\n", sum);
  while (!q.empty()) {
    printf("%d ", q.front());
    q.pop();
  }
  return 0;
}
