#include <bits/stdc++.h>
using namespace std;
int n, a[109][109];
bool vis[109];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      int x;
      scanf("%d", &x);
      if (x == 1)
        vis[i] = 1;
      else if (x == 2)
        vis[j] = 1;
      else if (x == 3)
        vis[i] = vis[j] = 1;
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cnt++;
  printf("%d\n", cnt);
  for (int i = 1; i <= n; i++)
    if (!vis[i]) printf("%d ", i);
  return 0;
}
