#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > tab(n, vector<int>(n));
  for (long long i = 0; i < (int)n; i++) {
    for (long long j = 0; j < (int)n; j++) cin >> tab[i][j];
  }
  vector<int> sol;
  for (long long i = 0; i < (int)n; i++) {
    bool isGood = true;
    for (long long j = 0; j < (int)n; j++)
      if (tab[i][j] == 1 || tab[i][j] == 3) isGood = false;
    if (isGood) sol.push_back(i + 1);
  }
  cout << sol.size() << endl;
  for (long long i = 0; i < (int)sol.size(); i++)
    if (i == sol.size() - 1)
      cout << sol[i] << endl;
    else
      cout << sol[i] << " ";
  return 0;
}
