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