#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long i, j, cars[n], count = 0;
  memset(cars, 0, sizeof(cars[0]) * n);
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      long long temp;
      cin >> temp;
      if (temp == 1)
        cars[i] = 1;
      else if (temp == 2)
        cars[j] = 1;
      else if (temp == 3) {
        cars[i] = 1;
        cars[j] = 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (cars[i] == 0) count++;
  }
  cout << count << endl;
  for (i = 0; i < n; i++) {
    if (cars[i] == 0) cout << i + 1 << " ";
  }
  return 0;
}
