#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return ((a * b) / gcd(a, b)); }
int main() {
  int n, i, j, a[101][101], b[101] = {0};
  cin >> n;
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= n; ++j) {
      cin >> a[i][j];
      if (a[i][j] == -1 || a[i][j] == 0)
        continue;
      else if (a[i][j] == 1)
        b[i] = 1;
      else if (a[i][j] == 2)
        b[j] = 1;
      else if (a[i][j] == 3)
        b[i] = 1, b[j] = 1;
    }
  }
  int count = 0;
  for (i = 1; i <= n; ++i) {
    if (b[i] == 0) ++count;
  }
  cout << count << endl;
  for (i = 1; i <= n; ++i) {
    if (b[i] == 0) cout << i << " ";
  }
}
