#include <bits/stdc++.h>
using namespace std;
long long i, j, n, a[105][105], k, p[105], t, z;
map<long long, long long> mp;
int main() {
  cin >> t;
  for (i = 1; i <= t; i++) {
    for (j = 1; j <= t; j++) {
      cin >> a[i][j];
    }
  }
  for (i = 1; i <= t; i++) {
    for (j = i + 1; j <= t; 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 (i = 1; i <= t; i++)
    if (p[i] == 0) z++;
  cout << z << endl;
  for (i = 1; i <= t; i++)
    if (p[i] == 0) cout << i << " ";
}
