#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[100][100];
  int count = 0;
  int b[100];
  for (int i = 0; i < n; i++) {
    b[i] = 0;
  }
  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++) {
    int win = 1;
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) {
        win = 0;
        break;
      }
    }
    if (win == 1) {
      count++;
      b[i] = 1;
    }
  }
  cout << count << "\n";
  for (int i = 0; i < n; i++) {
    if (b[i] == 1) {
      cout << i + 1 << " ";
    }
  }
  return 0;
}
