#include <bits/stdc++.h>
using namespace std;
int a[101];
int main() {
  int n, i, j, x;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      scanf("%d", &x);
      if (x == 1)
        a[i] = 1;
      else if (x == 2)
        a[j] = 1;
      else if (x == 3)
        a[i] = a[j] = 1;
    }
  int sum = 0;
  for (i = 0; i < n; i++)
    if (a[i] == 1) sum++;
  printf("%d\n", n - sum);
  for (i = 0; i < n; i++)
    if (!a[i]) printf("%d ", i + 1);
}
