#include <bits/stdc++.h>
using namespace std;
int a[10001];
int i, j, n, k;
int main() {
  cin >> n;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      cin >> k;
      if (k == 3 || k == 1) a[i] = -1;
    }
  k = 0;
  for (i = 0; i < n; i++)
    if (a[i] != -1) k++;
  cout << k << '\n';
  for (i = 0; i < n && k > 0; i++)
    if (a[i] != -1) cout << i + 1 << ' ';
  return 0;
}
