#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, i, j, cnt;
  cin >> n;
  vector<int> v(n + 1, 1);
  v[0] = 0;
  int a[n][n];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (a[i][j] == 1) {
        v[i + 1] = 0;
      } else if (a[i][j] == 2) {
        v[j + 1] = 0;
      } else if (a[i][j] == 3) {
        v[i + 1] = 0;
        v[j + 1] = 0;
      }
    }
  }
  cnt = count(v.begin(), v.end(), 1);
  cout << cnt << "\n";
  if (cnt > 0) {
    for (i = 1; i < v.size(); i++) {
      if (v[i]) {
        cout << i << " ";
      }
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
