#include <bits/stdc++.h>
using namespace std;
void init_ios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
int a[110][110], n;
vector<int> res;
bool check(int i) {
  for (int j = 1; j <= n; ++j)
    if (a[i][j] == 1 || a[i][j] == 3) return false;
  return true;
}
int main() {
  init_ios();
  cin >> n;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) cin >> a[i][j];
  for (int i = 1; i <= n; ++i)
    if (check(i)) res.push_back(i);
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); ++i) cout << res[i] << " ";
  cout << endl;
}
