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