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