#include <bits/stdc++.h>
using namespace std;
inline long long sn() {
  long long n = 0;
  long long ch = getchar();
  while (ch < 48) ch = getchar();
  while (ch > 47) n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  return n;
}
int main() {
  int i, j, n;
  n = sn();
  int x[105][105];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> x[i][j];
  vector<int> v;
  for (i = 0; i < n; i++) {
    int flag = 0;
    for (j = 0; j < n; j++) {
      if (x[i][j] == 1 || x[i][j] == 3) flag = 1;
    }
    if (flag == 0) v.push_back(i + 1);
  }
  int h = v.size();
  printf("%d\n", h);
  for (i = 0; i < v.size(); i++) printf("%d ", v[i]);
  printf("\n");
  return 0;
}
