#include <bits/stdc++.h>
using namespace std;
long long modPow(long long a, long long b);
long long modInv(long long a);
void solve() {
  long long n;
  cin >> n;
  long long a[n][n];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) cin >> a[i][j];
  }
  vector<long long> ans;
  for (long long i = 0; i < n; i++) {
    long long f1 = 0;
    for (long long j = 0; j < n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) {
        f1 = 1;
        break;
      }
    }
    if (!f1) ans.push_back(i + 1);
  }
  cout << ans.size() << "\n";
  for (auto i : ans) cout << i << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
}
long long modPow(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long x = a * a;
    x %= 1000000007;
    return modPow(x, b / 2);
  }
  return (a * modPow(a, b - 1)) % 1000000007;
}
long long modInv(long long a) { return modPow(a, 1000000007 - 2); }
