#include <bits/stdc++.h>
using namespace std;
long long int PASCAL[105][105] = {0};
void get_combinations() {
  int N, M, i, j;
  PASCAL[1][0] = PASCAL[1][1] = 1;
  for (i = 2; i <= 30; i++) {
    PASCAL[i][0] = 1;
    for (j = 1; j < i; j++)
      PASCAL[i][j] = PASCAL[i - 1][j] + PASCAL[i - 1][j - 1];
    PASCAL[i][i] = 1;
  }
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(int a, int b) { return a * b / gcd(a, b); }
void solve() {
  int n, x;
  cin >> n;
  vector<int> good;
  for (int i = 1; i <= n; i++) {
    bool cond = true;
    for (int j = 1; j <= n; j++) {
      cin >> x;
      if (x == 1 || x == 3) cond = false;
    }
    if (cond) good.push_back(i);
  }
  cout << good.size() << endl;
  for (auto x : good) cout << x << " ";
  cout << endl;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
