#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-8;
int cmp(double a, double b) {
  return (a + EPS < b) ? -1 : (a - EPS > b) ? 1 : 0;
}
long long MOD = 998244353;
int main() {
  int N;
  cin >> N;
  int M[N][N];
  vector<long long> ans;
  for (long long i = (0); i < (N); i++) {
    int cont = 0;
    for (long long j = (0); j < (N); j++) {
      cin >> M[i][j];
      if (M[i][j] == 0 or M[i][j] == 2) cont++;
    }
    if (cont == N - 1) ans.push_back(i + 1);
  }
  cout << ans.size() << endl;
  for (long long i = (0); i < (ans.size()); i++) cout << ans[i] << " ";
}
