#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  bool taken[n + 1];
  for (int i = 0; i < n + 1; i++) taken[i] = 0;
  int cc = 0;
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j <= n; j++) {
      int a;
      cin >> a;
      if (a == 2 && !taken[j]) taken[j] = 1, cc++;
      if (a == 3) {
        if (!taken[i]) taken[i] = 1, cc++;
        if (!taken[j]) taken[j] = 1, cc++;
      }
    }
  }
  cout << n - cc << endl;
  for (int i = 1; i < n + 1; i++)
    if (!taken[i]) cout << i << " ";
  return 0;
}
