#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cin >> a[i][j];
  }
  vector<int> b(n);
  int c = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) b[i] = 1;
      if (a[i][j] == 2 || a[i][j] == 3) b[j] = 1;
    }
  }
  for (int i : b) {
    if (i == 0) c++;
  }
  cout << c << '\n';
  for (int i = 0; i < n; i++) {
    if (b[i] == 0) cout << i + 1 << " ";
  }
}
