#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i, j, k = 0, f = 0;
  cin >> n;
  int a[n][n], b[n];
  for (i = 0; i < (n); i++) {
    for (j = 0; j < (n); j++) {
      cin >> a[i][j];
      if (a[i][j] == 1 || a[i][j] == 3) f = 1;
    }
    if (f == 0) {
      b[k] = i + 1;
      k++;
    } else
      f = 0;
  }
  cout << k << endl;
  for (i = 0; i < (k); i++) cout << b[i] << " ";
}
