#include <bits/stdc++.h>
using namespace std;
int n, ans;
vector<int> anss;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    bool ok = 1;
    for (int j = 0; j < n; j++) {
      cin >> x;
      if (x == 1 || x == 3) {
        ok = 0;
      }
    }
    if (ok) {
      ans++;
      anss.push_back(i + 1);
    }
  }
  cout << ans << endl;
  for (int i = 0; i < ans; i++) {
    cout << anss[i] << " ";
  }
  return 0;
}
