#include <bits/stdc++.h>
using namespace std;
const double mth_pi = 2 * acos(0.);
int a[101][101];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)n; i++)
    for (int j = 0; j < (int)n; j++) cin >> a[i][j];
  vector<int> ans, b(n, 0);
  for (int i = 0; i < (int)n; i++)
    for (int j = 0; j < (int)n; j++)
      if (a[i][j] == 1 || a[i][j] == 3) b[i] = 1;
  for (int i = 0; i < (int)n; i++)
    if (!b[i]) ans.push_back(i + 1);
  cout << ans.size() << '\n';
  for (int i = 0; i < (int)ans.size(); i++) cout << ans[i] << ' ';
  return 0;
}
