#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  int a[n][n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  int cnt2 = 0;
  int b[n];
  for (int i = 0; i < n; i++) b[i] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j] == 3 || a[i][j] == 1) cnt2++;
      if (a[j][i] == 3 || a[j][i] == 2) cnt2++;
    }
    if (cnt2 == 0) {
      cnt++;
      b[i] = i + 1;
    }
    cnt2 = 0;
  }
  cout << cnt << endl;
  if (cnt != 0) {
    for (int i = 0; i < n; i++)
      if (b[i] != 0) cout << b[i] << " ";
  }
  return 0;
}
