#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int flag, res[101][101], n, ans[101] = {0}, cnt = 0, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j) scanf("%d", &res[i][j]);
  for (i = 0; i < n; ++i) {
    flag = 0;
    for (j = 0; j < n; ++j) {
      if (res[i][j] == 3 || res[i][j] == 1) {
        flag = 1;
        break;
      }
    }
    if (!flag) {
      cnt++;
      ans[i] = 1;
    }
  }
  printf("%d\n", cnt);
  for (i = 0; i < n; ++i)
    if (ans[i]) printf("%d ", (i + 1));
  if (cnt) printf("\n");
  return 0;
}
