#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n + 1][n + 1], i, j, k = 0, b[n], c = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  if (n == 1) {
    if (a[1][1] == -1) {
      cout << "1"
           << "\n";
      cout << "1"
           << "\n";
    }
  } else {
    k = 0;
    int flag1 = 0, flag2 = 0;
    for (i = 1; i <= n; i++) {
      flag1 = 0;
      c = 0;
      for (j = 1; j <= n; j++) {
        if (i != j) {
          if (a[i][j] != 1 && a[i][j] != 3) flag1++;
        }
        if (j == n) {
          if (flag1 == (n - 1)) {
            b[k++] = i;
          }
          break;
        }
      }
    }
    cout << k << "\n";
    if (k != 0) {
      for (i = 0; i < k; i++) cout << b[i] << " ";
      cout << "\n";
    }
  }
  return 0;
}
