#include <bits/stdc++.h>
using namespace std;
int a[102][102], i, j, n, b, dg[102], ans = 0;
int main() {
  cin >> 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 u = true;
    for (j = 1; j <= n; j++)
      if (a[i][j] == 3 || a[i][j] == 1) {
        u = false;
        break;
      }
    if (u == false) continue;
    ans++, dg[ans] = i;
  }
  cout << ans << '\n';
  for (i = 1; i <= ans; i++) printf("%d ", dg[i]);
}
