#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool good[n];
  for (int i = 0; i < n; i++) good[i] = 1;
  for (int i = 0; i < n; i++) {
    int isGood = 1;
    for (int j = 0; j < n; j++) {
      int dum;
      cin >> dum;
      if (dum == 1 || dum == 3)
        good[i] = 0;
      else if (dum == 2)
        good[j] = 0;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (good[i]) ans++;
  cout << ans << endl;
  for (int i = 0; i < n; i++) {
    if (good[i]) cout << i + 1 << " ";
  }
  cout << endl;
  return 0;
}
