#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 9;
int x[105][105];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) cin >> x[i][j];
  map<int, int> ans;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (x[i][j] == 1) ans[i] = 1;
      if (x[i][j] == 3) ans[i] = 1, ans[j] = 1;
      if (x[i][j] == 2) ans[j] = 1;
    }
  }
  int an = 0;
  for (int i = 1; i <= n; ++i) {
    if (ans[i] == 0) ++an;
  }
  cout << an << "\n";
  for (int i = 1; i <= n; ++i) {
    if (ans[i] == 0) {
      cout << i << " ";
    }
  }
}
