#include <bits/stdc++.h>
int i, j, n, a[110][110], ans[110], count = 0;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) scanf("%d", &a[i][j]);
  for (i = 1; i <= n; i++) {
    bool good = true;
    for (j = 1; j <= n; j++)
      if (a[i][j] == 1 || a[i][j] == 3) good = false;
    if (good) ans[count++] = i;
  }
  printf("%d\n", count);
  for (i = 0; i < count; i++) printf("%d ", ans[i]);
  return 0;
}
