#include <bits/stdc++.h>
using namespace std;
int a[101][101], q[101];
int main() {
  int n, cnt = 0;
  bool b = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    b = 0;
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 1 || a[i][j] == 3) {
        b = 1;
      }
    }
    if (!b) {
      cnt++;
      q[cnt] = i;
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++) {
    cout << q[i] << " ";
  }
  return 0;
}
