#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i, j, c = 0;
  cin >> n;
  vector<bool> b(n + 1, 0);
  long long x;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> x;
      if (x == 1)
        b[i + 1] = 1;
      else if (x == 2)
        b[j + 1] = 1;
      else if (x == 3)
        b[i + 1] = b[j + 1] = 1;
    }
  }
  for (i = 1; i <= n; i++)
    if (!b[i]) c++;
  cout << c << "\n";
  for (i = 1; i <= n; i++)
    if (!b[i]) cout << i << " ";
  return 0;
}
