#include <bits/stdc++.h>
using namespace std;
const long long int inf = LLONG_MAX;
const long long int mod = 1e9 + 7;
const long long int N = 1e2 + 1;
long long int a[N][N];
long long int n;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long int i = 0; i < n; ++i) {
    for (long long int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }
  vector<long long int> good;
  for (long long int i = 0; i < n; ++i) {
    bool g = true;
    for (long long int j = 0; j < n; ++j) {
      if (a[i][j] == 1 or a[i][j] == 3) {
        g = false;
      }
    }
    if (g) good.push_back(i);
  }
  cout << good.size() << endl;
  for (auto &i : good) {
    cout << i + 1 << ' ';
  }
  cout << endl;
  return 0;
}
