#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int a[maxn][maxn];
int ans[maxn];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        scanf("%d", &a[i][j]);
      }
    }
    int tot = 1;
    for (int i = 1; i <= n; i++) {
      bool flag = true;
      for (int j = 1; j <= n; j++) {
        if (a[i][j] == 3 || a[i][j] == 1) {
          flag = false;
          break;
        }
      }
      if (flag) {
        ans[tot++] = i;
      }
    }
    tot--;
    printf("%d\n", tot);
    if (tot == 0) continue;
    for (int i = 1; i < tot; i++) printf("%d ", ans[i]);
    printf("%d\n", ans[tot]);
  }
  return 0;
}
