#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &(n));
  int arr[n];
  memset(arr, 0, sizeof(arr));
  int m = 0;
  set<int> ints;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &(m));
      if (m == 3) {
        arr[i] = 1;
        arr[j] = 1;
      } else if (m == 1) {
        arr[i] = 1;
      } else if (m == 2) {
        arr[j] = 1;
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] == 0) cnt++;
  }
  printf("%d\n", cnt);
  for (int i = 0; i < n; i++) {
    if (arr[i] == 0) printf("%d ", i + 1);
  }
  return 0;
}
