#include <bits/stdc++.h>
using namespace std;
int k[100 + 10][100 + 10];
int a[100 + 10];
int main() {
  int n, z = 0, u = 0, x = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> k[i][j];
      if (k[i][j] == -1 || k[i][j] == 2) {
        k[i][j] = 0;
      }
      if (k[i][j] != 0) {
        z++;
      }
    }
    if (z == 0) {
      x++;
      a[u] = i + 1;
      u++;
    }
    z = 0;
  }
  cout << x << endl;
  for (int i = 0; i < u; i++) {
    cout << a[i] << " ";
  }
}
