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