#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int a[n][n];
  long long int b[n + 1];
  memset(b, 0, sizeof(b));
  long long int x = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 1) {
        x = i + 1;
        b[x] = 1;
      }
      if (a[i][j] == 2) {
        x = j + 1;
        b[x] = 1;
      }
      if (a[i][j] == 3) {
        b[i + 1] = 1;
        b[j + 1] = 1;
      }
    }
  }
  long long int cnt = 0;
  for (long long int i = 1; i <= n; i++) {
    if (b[i] == 0) cnt++;
  }
  cout << cnt << "\n";
  for (long long int i = 1; i <= n; i++) {
    if (b[i] == 0) cout << i << " ";
  }
  return 0;
}
