#include <bits/stdc++.h>
using namespace std;
const double error = 1e-15;
const double pi = 2 * acos(0);
const int maxn = (int)1e5 + 10;
const int mod = (int)1e9;
int dx[] = {0, -1, 0, +1, -1, -1, +1, +1};
int dy[] = {-1, 0, +1, 0, -1, +1, +1, -1};
long A[205][200], B[200];
vector<int> v;
int main() {
  ios_base::sync_with_stdio(0);
  long i, j, n, m;
  cin >> n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      cin >> A[i][j];
      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;
      }
    }
  m = 0;
  for (i = 1; i <= n; i++)
    if (B[i] == 0) {
      m++;
      v.push_back(i);
    }
  cout << m << endl;
  for (i = 0; i < m; i++) cout << v[i] << " ";
  return 0;
}
