#include <bits/stdc++.h>
using namespace std;
int NODES;
int fx[] = {1, -1, 0, 0, 1, 1, -1, -1};
int fy[] = {0, 0, 1, -1, 1, -1, 1, -1};
char cell[105][105];
int d[100][100], vis[105][105];
int row, col;
void bfs(int sx, int sy) {
  vis[sx][sy] = 1;
  cell[sx][sy] = 'L';
  queue<pair<int, int> > q;
  q.push(pair<int, int>(sx, sy));
  while (!q.empty()) {
    pair<int, int> top = q.front();
    q.pop();
    for (int k = 0; k < 4; k++) {
      int tx = top.first + fx[k];
      int ty = top.second + fy[k];
      if (tx >= 0 && tx < row && ty >= 0 && ty < col && cell[tx][ty] != 'L' &&
          vis[tx][ty] == 0) {
        vis[tx][ty] = 1;
      }
    }
  }
}
int main() {
  int test_cases = 0, i, j, n, x = 0, k, m, y = 0;
  int ax[105], a[105][105];
  while (scanf("%d", &n) == 1) {
    k = 0;
    memset(ax, 0, sizeof ax);
    for (i = 1; i <= n; i++)
      for (j = 1; j <= n; j++) {
        scanf("%d", &a[i][j]);
        if (a[i][j] == 1)
          ax[i]++;
        else if (a[i][j] == 2)
          ax[j]++;
        else if (a[i][j] == 3) {
          ax[i]++;
          ax[j]++;
        }
      }
    for (i = 1; i <= n; i++)
      if (ax[i]) k++;
    cout << n - k << "\n";
    for (i = 1; i <= n; i++) {
      if (!ax[i]) cout << i << " ";
    }
    cout << "\n";
  }
  return 0;
}
