#include <bits/stdc++.h>
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
const char nl = '\n';
using namespace std;
const int nax = 500005;
void solve() {
  int n;
  cin >> n;
  int a[n][n];
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (n); j++) cin >> a[i][j];
  set<int> ans;
  for (int row = 0; row < (n); row++) {
    bool otase = false;
    for (int col = 0; col < (n); col++) {
      if (a[row][col] == 1 || a[row][col] == 3) {
        otase = true;
      }
    }
    if (otase == false) ans.insert(row + 1);
  }
  cout << (int)ans.size() << nl;
  for (auto x : ans) cout << x << " ";
  cout << nl;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  int t = 1;
  for (long long cas = 1; cas <= t; cas++) {
    solve();
  }
  return 0;
}
