#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, num, good[200], ans = 0;
  memset(good, 1, sizeof(good));
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      cin >> num;
      if (num == 1) good[i] = 0;
      if (num == 2) good[j] = 0;
      if (num == 3) good[i] = good[j] = 0;
    }
  for (int i = 1; i <= n; i++) {
    if (good[i]) ans++;
  }
  cout << ans << "\n";
  for (int i = 1; i <= n; i++) {
    if (good[i]) cout << i << " ";
  }
  return 0;
}
