#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int res[100];
    memset(res, 0, sizeof(res));
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        int r;
        cin >> r;
        if (i < j) continue;
        switch (r) {
          case 1:
            ++res[i];
            break;
          case 2:
            ++res[j];
            break;
          case 3:
            ++res[i];
            ++res[j];
          default:
            break;
        }
      }
    }
    int count = 0;
    for (int i = 0; i < n; ++i) {
      if (res[i] == 0) {
        res[count++] = i + 1;
      }
    }
    cout << count << endl;
    if (count > 0) {
      for (int i = 0; i < count; ++i) {
        cout << res[i] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
