#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  int flag = 0;
  int sum = 0;
  int x;
  int array[n];
  for (int i = 0; i < n; i++) {
    flag = 0;
    for (int j = 0; j < n; j++) {
      cin >> x;
      if (x == 1 | x == 3) {
        array[i] = 1;
        flag = 1;
      }
    }
    (flag == 1) ? sum++ : sum = sum;
    (flag == 1) ? array[i] = 1 : array[i] = 0;
  }
  cout << n - sum << endl;
  for (int i = 0; i < n; i++) {
    if (array[i] == 0) {
      cout << i + 1 << " ";
    }
  }
  return 0;
}
