#include <bits/stdc++.h>
using namespace std;
int a[105][105];
int main() {
  vector<int> v;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cin >> a[i][j];
    v.push_back(i);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    int flag = 0;
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == 1 || a[i][j] == 3 || a[j][i] == 2 || a[j][i] == 3) {
        flag = 1;
        v[i - 1] = 0;
      }
    }
    if (flag == 0) cnt++;
  }
  cout << cnt << endl;
  for (auto i = v.begin(); i != v.end(); i++) {
    if (*i != 0) cout << *i << " ";
  }
  v.clear();
}
