#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int t, x, n, res;
  cin >> n;
  int mat[n][n];
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int flag = 1;
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
      if (mat[i][j] == 1 || mat[i][j] == 3) {
        flag = 0;
      }
    }
    if (flag) {
      v.push_back(i + 1);
    }
  }
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
  return 0;
}
