#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0, arr[105][105];
  cin >> n;
  vector<int> iout(n + 1), res(n);
  for (int i = 1; i <= n; i++) iout[i] = i;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> arr[i][j];
      if (arr[i][j] == 1) iout[i] = 0;
      if (arr[i][j] == 3) {
        iout[i] = 0;
        iout[j] = 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (iout[i] != 0) cnt++;
  }
  cout << cnt << endl;
  for (int i = 1; i <= n; i++) {
    if (iout[i] != 0) cout << iout[i] << " ";
  }
  puts("");
  return 0;
}
