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