#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n;
  int cars[n][n];
  int flag = 0;
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    flag = 0;
    for (int j = 0; j < n; j++) {
      scanf("%d", &cars[i][j]);
      if (cars[i][j] == -1 || cars[i][j] == 2 || cars[i][j] == 0) flag++;
    }
    if (flag == n) ans.push_back(i + 1);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
