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