#include <bits/stdc++.h>
using namespace std;
long long EPS = 1000000007;
long double PI = 3.14159265358979323846;
const int MAXN = 1000010;
long long abss(long long h) { return max(h, -h); }
long double fabss(long double h) { return max(h, -h); }
long long ceill(long long x, long long y) {
  if (x % y != 0) {
    return (x / y) + 1;
  }
  return x / y;
}
string itos(long long num) {
  string str = "";
  if (num == 0) {
    return "0";
  }
  while (num != 0) {
    str += ((num % 10) + '0');
    num /= 10;
  }
  reverse(str.begin(), str.end());
  return str;
}
long long n, m, k, r, t;
int a[110][110];
int b[MAXN];
int c[MAXN];
vector<int> p[MAXN];
map<int, int> ma;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) {
        continue;
      }
      if (a[i][j] == 1 || a[i][j] == 3) {
        b[i] = 1;
      }
    }
  }
  vector<int> answer;
  for (int i = 0; i < n; i++) {
    if (b[i] == 0) {
      answer.push_back(i + 1);
    }
  }
  cout << answer.size() << endl;
  for (int i = 0; i < answer.size(); i++) {
    cout << answer[i] << " ";
  }
}
