#include <bits/stdc++.h>
using namespace std;
int arr[110];
int main() {
  int n, i, a, k, x;
  cin >> n;
  k = 0;
  for (i = 1; i <= n; i++) {
    for (a = 1; a <= n; a++) {
      cin >> x;
      if (x == 1) {
        if (arr[i] == 0) k++;
        arr[i]++;
      } else if (x == 2) {
        if (arr[a] == 0) k++;
        arr[a]++;
      } else if (x == 3) {
        if (arr[i] == 0) k++;
        if (arr[a] == 0) k++;
        arr[i] = 1;
        arr[a] = 1;
      }
    }
  }
  cout << n - k << "\n";
  ;
  for (i = 1; i <= n; i++) {
    if (arr[i] == 0) cout << i << " ";
  }
}
