#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int arr[n + 1][n + 1];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> arr[i][j];
    }
  }
  bool b[n + 1];
  vector<int> v;
  int count = 0;
  for (int i = 1; i <= n; i++) {
    b[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (arr[i][j] == 1) {
        b[i] = 0;
      }
      if (arr[i][j] == 2) {
        b[j] = 0;
      }
      if (arr[i][j] == 3) {
        b[i] = 0;
        b[j] = 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (b[i] == 1) {
      count++;
      v.push_back(i);
    }
  }
  if (v.size() == 0) {
    cout << "0"
         << "\n";
    ;
  } else {
    cout << count << "\n";
    ;
    for (auto k : v) cout << k << " ";
    cout << "\n";
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
