#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const int MAXN = 1e2 + 5;
const long long MOD = 1e9 + 7;
int v[MAXN][MAXN];
vector<int> ans;
void solve() {
  int i, j, n;
  cin >> n;
  for ((i) = (0); (i) < (int)(n); (i)++) {
    int fl = 0;
    for ((j) = (0); (j) < (int)(n); (j)++) {
      cin >> v[i][j];
      if (v[i][j] == 1 || v[i][j] == 3) {
        fl = 1;
      }
    }
    if (!fl) {
      ans.push_back(i + 1);
    }
  }
  cout << (int)(ans).size() << endl;
  for ((i) = (0); (i) < (int)((int)(ans).size()); (i)++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
