#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ar[109][109];
  while (cin >> n) {
    int v[109];
    for (int i = 1; i <= n; i++) v[i] = i;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        cin >> ar[i][j];
        if (ar[i][j] == 1)
          v[i + 1] = 0;
        else if (ar[i][j] == 2)
          v[j + 1] = 0;
        else if (ar[i][j] == 3)
          v[i + 1] = 0, v[j + 1] = 0;
      }
    }
    for (int i = 1; i <= n; i++)
      if (v[i] != 0) cnt++;
    cout << cnt << endl;
    if (cnt == 0) return 0;
    for (int i = 1; i <= n; i++) {
      if (v[i] != 0) cout << v[i] << " ";
    }
  }
  return 0;
}
