#include <bits/stdc++.h>
using namespace std;
long long n, c, a[111][111];
int main() {
  cin >> n;
  int s[1111];
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cin >> a[i][j];
      if (a[i][j] == 1 || a[i][j] == 3) {
        s[i] = 1;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (a[i][j] == 2 || a[i][j] == 3) {
        s[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (s[i] == 0) {
      c++;
    }
  }
  cout << c << endl;
  for (int j = 1; j <= n; ++j) {
    if (s[j] == 0) {
      cout << j << ' ';
    }
  }
  return 0;
}
