#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
int a[1000];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    bool ok = true;
    for (int j = 0; j < n; j++) {
      int t;
      cin >> t;
      if (t != 0 && t != 2 && t != -1) {
        ok = false;
      }
    }
    if (ok) {
      a[ans] = i + 1;
      ans++;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < ans; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
