#include <bits/stdc++.h>
using namespace std;
int T[110][110];
bool J[110];
int main(void) {
  int N;
  cin >> N;
  for (int i = 0; i < 110; i++) J[i] = false;
  int x;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) {
      cin >> x;
      if (x == 1) J[i] = true;
      if (x == 2) J[j] = true;
      if (x == 3) {
        J[i] = true;
        J[j] = true;
      }
    }
  int s = 0;
  for (int i = 0; i < N; i++)
    if (!J[i]) s++;
  cout << s << endl;
  for (int i = 0; i < N; i++)
    if (!J[i]) cout << i + 1 << " ";
  cout << endl;
  return 0;
}
