#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x = 0, y = 0;
  char p[100], b[100];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
    if (p[i] > b[i]) {
      x++;
    } else if (p[i] < b[i]) {
      y++;
    }
  }
  if (x == 0) {
    cout << "-1";
  } else {
    cout << (y / x) + 1;
  }
  return 0;
}
