#include <bits/stdc++.h>
int arr[105];
int main() {
  memset(arr, 0, sizeof(arr));
  int n, t;
  scanf("%d", &n);
  int ans = 0;
  int i, j;
  int good;
  for (i = 0; i < n; i++) {
    good = 1;
    for (j = 0; j < n; j++) {
      scanf("%d", &t);
      if (t == 1 || t == 3) good = 0;
    }
    if (good) {
      arr[i + 1] = 1;
      ans++;
    }
  }
  printf("%d\n", ans);
  for (i = 1; i <= n; i++)
    if (arr[i]) printf("%d ", i);
  return 0;
}
