#include <bits/stdc++.h>
using namespace std;
int m[101], i, j;
int main() {
  int k, n, count = 0;
  cin >> k;
  for (; i < k; i++) {
    for (j = 0; j < k; j++) {
      cin >> n;
      if (i != j) {
        if (n == 1)
          m[i] = 1;
        else if (n == 2)
          m[j] = 1;
        else if (n == 3) {
          m[i] = 1;
          m[j] = 1;
        }
      }
    }
  }
  for (j = 0; j < k; j++) {
    if (m[j] == 0) count++;
  }
  if (count == 0)
    cout << 0;
  else {
    cout << count << endl;
    for (i = 0; i < k; i++)
      if (!m[i]) cout << i + 1 << " ";
  }
}
