#include <bits/stdc++.h>
using namespace std;
int used[110];
int v[110][110];
vector<int> ans;
int main() {
  int n, x;
  memset(used, 0, sizeof(used));
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> x;
      if (x == 1) {
        used[i] = 1;
      } else if (x == 2) {
        used[j] = 1;
      } else if (x == 3) {
        used[i] = used[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  if (!ans.size()) return 0;
  bool cond = true;
  for (int i = 0; i < (int)ans.size(); i++) {
    if (!cond) cout << " ";
    cout << ans[i];
    cond = false;
  }
  cout << endl;
  return 0;
}
