#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, res;
  cin >> n;
  int ara[n][n], ind[n + 1];
  memset(ind, 0, sizeof ind);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> ara[i][j];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      if (ara[i][j] == 1)
        ind[i + 1] = 1;
      else if (ara[i][j] == 2)
        ind[j + 1] = 1;
      else if (ara[i][j] == 3)
        ind[i + 1] = 1, ind[j + 1] = 1;
    }
  res = 0;
  for (i = 1; i <= n; i++)
    if (ind[i] == 0) res++;
  cout << res << endl;
  for (i = 1; i <= n; i++)
    if (ind[i] == 0) cout << i << ' ';
  cout << endl;
  return 0;
}
