#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int p[109][109] = {0};
  int pi[109] = {0}, pj[109] = {0};
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      cin >> p[i][j];
      if (p[i][j] == 3) {
        pi[i]++;
        pj[j]++;
      } else if (p[i][j] == 1)
        pi[i]++;
      else if (p[i][j] == 2)
        pj[j]++;
    }
  for (int i = 1; i <= n; i++)
    if (!pi[i] & !pj[i]) v.push_back(i);
  cout << v.size() << endl;
  for (int i = 0, s = v.size(); i < s; i++) cout << v[i] << ' ';
  return 0;
}
