import java.util.Scanner

object Main {
  def solve(N: Int, T: Array[Long], A: Array[Long]): Long = {
    // leastFeasibleMultiple
    def lfm(factor: Long, n: Long): Long = {
      if (n % factor == 0) n / factor
      else n / factor + 1
    }

    def step(i: Int, dT: Long, dA: Long): Long = i match {
      case N => dT + dA
      case _ =>
        // dT(i + 1) >= dT(i) && dA(i + 1) >= dA(i) && dT(i + 1) が T(i) の倍数 && dA(i + 1) が A(i)　の倍数
        // これらの条件を満たすには・・・・・説明むずい
        val multiple = math.max(lfm(T(i), dT), lfm(A(i), dA))
        step(i + 1, T(i) * multiple, A(i) * multiple)
    }

    step(0, 1, 1)
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N = sc.nextInt()
    val T = Array.ofDim[Long](N)
    val A = Array.ofDim[Long](N)
    (0 until N) foreach { i =>
      T(i) = sc.nextLong()
      A(i) = sc.nextLong()
    }
    System.out.println(solve(N, T, A))
  }
}
