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