#include <bits/stdc++.h>
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T>
inline void scand(T &x) {
  char c;
  x = 0;
  while ((c = getchar()) < '0')
    ;
  while (c >= '0' && c <= '9') x = x * 10 + (c - 48), c = getchar();
}
template <class T>
inline void gmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline void gmin(T &a, T b) {
  if (b < a) a = b;
}
using namespace std;
const int N = 105, M = 0, L = 0, Z = 1e9 + 7, t30 = 1 << 30,
          maxint = 2147483647, ms31 = 522133279, ms63 = 1061109567,
          ms127 = 2139062143;
const double eps = 1e-8, PI = acos(-1.0);
struct A {};
map<int, int> mop;
int casenum, casei, inf;
int n, i, j;
int a[N][N];
bool e[N];
int main() {
  while (~scanf("%d", &n)) {
    memset(e, 1, sizeof(e));
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        scanf("%d", &a[i][j]);
        if (a[i][j] == 1)
          e[i] = 0;
        else if (a[i][j] == 2)
          e[j] = 0;
        else if (a[i][j] == 3)
          e[i] = e[j] = 0;
      }
    }
    int ans = 0;
    for (i = 1; i <= n; i++)
      if (e[i]) ans++;
    printf("%d\n", ans);
    for (i = 1; i <= n; i++)
      if (e[i]) printf("%d ", i);
    printf("\n");
  }
  return 0;
}
