#include <bits/stdc++.h>
using namespace std;
int a[101][101];
map<string, int> mymap;
vector<pair<int, int> > v;
struct edge {
  long int u, v;
  long int w;
  bool operator<(const edge& p) const { return w < p.w; }
};
vector<edge> e;
map<string, int>::iterator it;
int main() {
  long long int i, j, k, l, n, m, t, s = 0, c = 0, b[101];
  cin >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) cin >> a[i][j];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3) {
        break;
      }
    }
    if (j == n) {
      b[c] = i + 1;
      c = c + 1;
    }
  }
  cout << c << endl;
  for (i = 0; i < c; i++) {
    cout << b[i] << " ";
  }
  cout << endl;
  return 0;
}
