#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
template <typename T>
void scan(T &x) {
  x = 0;
  bool neg = 0;
  register T c = getchar();
  if (c == '-') neg = 1, c = getchar();
  while ((c < 48) || (c > 57)) c = getchar();
  for (; c < 48 || c > 57; c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) x = (x << 3) + (x << 1) + (c & 15);
  if (neg) x *= -1;
}
template <typename T>
void print(T n) {
  bool neg = 0;
  if (n < 0) n *= -1, neg = 1;
  char snum[65];
  int i = 0;
  do {
    snum[i++] = n % 10 + '0';
    n /= 10;
  } while (n);
  --i;
  if (neg) putchar('-');
  while (i >= 0) putchar(snum[i--]);
  putchar('\n');
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    long long n, x;
    cin >> n;
    long long ans = 0;
    vector<long long> vec;
    for (long long i = 0; i < n; i++) {
      long long flag = 1;
      for (long long j = 0; j < n; j++) {
        cin >> x;
        if (x == 1 || x == 3) {
          flag = 0;
        }
      }
      if (flag == 1) {
        ans++;
        vec.push_back(i + 1);
      }
    }
    cout << ans << endl;
    for (long long i = 0; i < vec.size(); i++) {
      cout << vec[i] << " ";
    }
  }
}
