#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = 0;
  int arr[105];
  int x = 0;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++) {
      int a;
      cin >> a;
      if (a != 1 && a != 3) {
        cnt++;
      }
    }
    if (cnt == n) {
      ans++;
      arr[x] = i + 1;
      x++;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < x; i++) cout << arr[i] << " ";
  return 0;
}
