#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n + 1][n + 1];
  bool check[n + 1];
  memset(check, true, sizeof(check));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i][j] == 1) {
        check[i] = false;
      }
      if (a[i][j] == 2) {
        check[j] = false;
      }
      if (a[i][j] == 3) {
        check[i] = false;
        check[j] = false;
      }
    }
  }
  int ans1 = 0;
  for (int i = 1; i <= n; i++) {
    if (check[i] == true) {
      ans1++;
    }
  }
  cout << ans1 << endl;
  for (int i = 1; i <= n; i++) {
    if (check[i] == true) {
      cout << i << " ";
    }
  }
  cout << endl;
  return 0;
}
