#include <bits/stdc++.h>
using namespace std;
void ff() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
void in_out_txt() {
  freopen("input.txt", "rt", stdin);
  freopen("output.txt", "wt", stdout);
}
long long fp(long x, long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long res = fp(x, y / 2) % 1000000007;
  res = (res * res) % 1000000007;
  if (y % 2 != 0) res = res * x;
  res %= 1000000007;
  return res;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  short n;
  short x[100][100];
  cin >> n;
  short *y = new short[n];
  for (short i = 0; i < n; i++)
    for (short j = 0; j < n; j++) cin >> x[i][j];
  for (short i = 0; i < n; i++) y[i] = 0;
  for (short i = 0; i < n; i++) {
    for (short j = 0; j < n; j++) {
      if (x[i][j] == 1) {
        y[i] = 1;
      } else if (x[i][j] == 2) {
        y[j] = 1;
      } else if (x[i][j] == 3) {
        y[i] = 1;
        y[j] = 1;
      }
    }
  }
  cout << count(y, y + n, 0) << endl;
  for (short i = 0; i < n; i++) {
    if (y[i] == 0) cout << i + 1 << " ";
  }
  return 0;
}
