Harryxun/stf_run huggingface dataset:
ls = []
while True:
    try:
        data = map(float,raw_input().split())
        ls.append(data)
    except EOFError:
        break
ls.sort()
ans = ls[-1]-ls[0]
print ans
    

### FIXED CODE ###

ls = []
while True:
    try:
        data = float(raw_input())
        ls.append(data)
    except EOFError:
        break
        
print max(ls)-min(ls)
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
# import numpy as np

inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""
from collections import deque, defaultdict, Counter
import math
import sys
sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))
# WideIntPoint


def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  # SingleInt


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  # HeightString


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  # MatrixInt


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  # NumberGrid


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a/b の切り上げ


def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def main():
    s = input()

    cnt = [0] * 2019
    # print(cnt)
    cnt[0] = 1
    ans = 0
    b = 0
    t = 1
    for i in s:
        b = b + int(i) * t
        b % 2019
        cnt[b] += 1
        t *= 10
        t %= 2019

    for i in cnt:
        ans += i * (i - 1) // 2
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

s = input()[::-1]

sum_of_digits = 0

cnts = [0] * 2019

cnts[0] = 1

d = 1

for c in s:
    sum_of_digits += int(c) * d
    sum_of_digits %= 2019
    d *= 10
    d %= 2019
    cnts[sum_of_digits] += 1

ans = 0

for cnt in cnts:
    ans += cnt * (cnt - 1) // 2

print(ans)
n,a,b=map(int,input().split())
s=list(map(int,input().split())
t=0
for i in range(n-1):
	t+=min(b,a*(s[i+1]-s[i]))

print(t)

### FIXED CODE ###

n,a,b=map(int,input().split())
s=list(map(int,input().split()))
t=0

for i in range(n-1):
	t+=min(b,a*(s[i+1]-s[i]))

print(t)
A, B = map(int, input().split())
 
if A % B == 0：
    print(A+B)
else:
    print(A-B)
    

### FIXED CODE ###

A, B = map(int, input().split())
 
if B % A == 0:
    print(A + B)
else:
    print(B - A)
t = int(input())
for i in range(t):
    able = "Yes"
    a,b,c,d = map(int, input().split())
    if a - b < 0:
        able = "No"
    else:
        x = c+(a-c)%b
        if x <= c:
            x+=d
        for i in range(1100):
            x-=b
            if x >= 0:
                if x <= c:
                    x+=d
            else:
                able = "No"
                break
    print(able)

### FIXED CODE ###

n = int(input())
a= list(input().split())
res = 0
for i in range(n-1):
    if a[i] == a[i+1]:
        a[i+1]=10001
        res +=1
print(res)
raw = raw_input()
if raw %= 4:
    return "Yes"
return "No"


### FIXED CODE ###


raw = raw_input().split(" ")
num = int(raw[0]) * 100 + int(raw[1]) * 10 + int(raw[2])
if not (num % 4):
    print 'YES'
else:
    print 'NO'
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main(): #startline-------------------------------------------
    a,b = map(int,input().split())
    if a+b == 15:
        print("+")
    elif a*b == 15:
        print("*")
    else:
        print("x")
if __name__ == "__main__":
    main() #endline===============================================

### FIXED CODE ###

a,b = map(int,input().split())
if a+b == 15:
        print("+")
elif a*b == 15:
        print("*")
else:
        print("x")
from collections import defaultdict

Ss = input()
T =  input()

Tdic = defaultdict(lambda: len(T))

for idx,i in  enumerate(T):
    Tdic[i] = len(T) -(idx+1)
    
Tdic[T[-1]] = len(T)
Tdic["?"] = 1
    
Flag = False
mutchdic = dict()
mutch = 0
head = len(T)-1
          
while(1):
    for i in range(len(T)):
        if T[-(i+1)] == Ss[head-i]:
            mutch += 1
            if i+1 == len(T):
                mutchdic[head] = mutch
                head += len(T)
                mutch = 0
                Flag = True
        elif Ss[head-i] == "?":
            if i+1 == len(T):
                mutchdic[head] = mutch
                head += 1
                mutch = 0
                Flag = True
        else:
            mutchdic[head] = mutch
            head += Tdic[Ss[head]]
            break
    if head > len(Ss)-1:
        break

if Flag:
    SsL = list(Ss)
    max_head = max(mutchdic.items(), key=lambda x:x[1])[0]
    for i in range(len(T)):
        SsL[max_head-i] = T[-(i+1)]
        SsLstr = "".join(SsL)
        SsLstr=SsLstr.replace("?","a")
        ans = SsLstr
else:
    ans = "UNRESTORABLE"

print(ans)

### FIXED CODE ###

Sd = input()
T  = input()

S_r = Sd[::-1]
T_r = T[::-1]

lenS = len(Sd)
lenT = len(T)

Flag2 = True

if lenS < lenT:
    pass
else:
    for i in range(lenS - lenT + 1):
        for j in range(lenT):
            Flag1 = True
            if S_r[i+j] == "?" or S_r[i+j] == T_r[j]:
                pass
            else:
                Flag1 =False
                break
        if Flag1:
            Flag2 = False
            S_r = S_r.replace(S_r[i:i+lenT],T_r,1)
            S_r = S_r.replace("?","a")
            ans = S_r[::-1]
            break

if Flag2:
    ans = "UNRESTORABLE"
print(ans)
import sys
sys.setrecursionlimit(1500)
n=int(input())
arr=list(map(int,input().split()))
vis={}
vis[0] = 0
vis[1] = 0
if n > 1:
  vis[2] = abs(arr[0]-arr[1])
def count(n):
  	n = n-1
  	if n in vis:
      return vis[n]
    step_1 = abs(arr[n]-arr[n-1])+count(n-1)
    step_2 = abs(arr[n]-arr[n-2])+count(n-2)
    vis[n] = min(step_1, step_2)
    return vis[n]
print(count(n))

### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
if n < 2:
  print(0)
vis = [0] * n
vis[0] = 0
vis[1] = abs(arr[0]-arr[1])
for i in range(2, n):
    step_1 = abs(arr[i]-arr[i-1]) + vis[i-1]
    step_2 = abs(arr[i]-arr[i-2]) + vis[i-2]
    vis[i] = min(step_1, step_2)
print(vis[-1])
import itertools

cnt_500 = int(input())
cnt_100 = int(input())
cnt_50 = int(input())
target_amount = int(input())

cnt_500_arr = [i for i in range(cnt_500+1)]
cnt_100_arr = [i for i in range(cnt_100+1)]
cnt_50_arr = [i for i in range(cnt_50+1)]

coin_combinations = list(itertools.product(cnt_500_arr, cnt_100_arr, cnt_50_arr))

result_count = 0
for cnt_500, cnt_100, cnt_50 in coin_combinations:
	amount = cnt_500 * 500 + cnt_100 * 100 + cnt_50 * 50
	if amount == target_amount:
		result_count += 1
print(result_count)

### FIXED CODE ###

str = input()
count = 0
for char in str:
  if char == '1':
    count += 1

print(count)
def check2(x,y,p):
    t = min(x,y)
    for i in range(p+1,t):
        if x % i == 0 and y % i == 0 :
            return i
        if i * i >= t :
            return 0
A,B = map(int,input().split())
ans = 1
p = 1
while True :
    p = check2(A,B,p)
    if p == 0 :
        break
    A = (A // p)
    B = (B // p)
    while True :
        if A % p == 0 and B % p == 0 :
            A = (A//p)
            B = (B//p)
        else :
            break
    ans += 1
print(ans)

### FIXED CODE ###

def gcd(x, y):
    if y == 0 :
        return x
    else:
        return gcd(y,x%y)
def prime(x):
    global  ans
    m = x ** (0.5)
    for i in range(2,int(m+1)):
        if x % i == 0 :
            while True:
                if x % i != 0 :
                    break
                else:
                    x = (x//i)
            ans +=1
    if x != 1 :
        ans += 1
    return ans
A,B = map(int,input().split())
t = gcd(A,B)
ans = 1
print(prime(t))
import math
x1, y1, x2, y2 = map(int, input().split())
print("{:.8f}".format(math.sqrt((x2-x1)**2 + (y2-y1)**2)))


### FIXED CODE ###

x1, y1, x2, y2 = map(float, input().split())
print("{:.5f}".format(((x2-x1)**2 + (y2-y1)**2)**0.5))
import heapq
n,m = map(int,input().split())
L = [  -i for i in map(int, input().split())]
heapify(L)
for _ in range(m):
    heapreplace(L,L[0]//2 + L[0]%2)
print(-sum)

### FIXED CODE ###

from heapq import heapify, heapreplace
n,m = map(int,input().split())
L = [  -i for i in map(int, input().split())]
heapify(L)
for _ in range(m):
    heapreplace(L,L[0]//2 + L[0]%2)
print(-sum(L))
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32
from bisect import bisect_left, bisect_right

def solve(N: int, a: "List[int]"):
    x = [[i+1, a[i]] for i in range(N)]

    x = sorted(x, key=lambda x:x[1])
    x1 = [i for i,j in x]
    x2 = [j for i,j in x]

    ans = 0
    for i in range(N):
        p = bisect_left(x2, x1[i])
        if x1[i] == x2[p]:
            if x2[i] == x1[p]:
                ans += 1

    print(ans//2)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32
from bisect import bisect_left, bisect_right

def solve(N: int, a: "List[int]"):
    # x = [[i+1, a[i]] for i in range(N)]

    # x = sorted(x, key=lambda x:x[1])
    # x1 = [i for i,j in x]
    # x2 = [j for i,j in x]

    # ans = 0
    # for i in range(N):
    #     p = bisect_left(x2, x1[i])
    #     if not (0 <= p < N):
    #         continue
    #     if x1[i] == x2[p] and x2[i] == x1[p]:
    #         ans += 1

    # print(ans//2)

    ans = 0
    for i in range(N):
        if a[a[i]-1] == i+1:
            ans += 1

    print(ans//2)


    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()
def solve():
  from itertools import accumulate
  from sys import stdin
  
  f_i = stdin
  N, K = map(int, f_i.readline().split())
  A = map(int, f_i.readline().split())
  S = accumulate(a - 1 for a in A)
  S = (0, ) + tuple(s % K for s in S)
  
  rec = [0] * K
  
  ans = 0
  for j, S_j in enumerate(S):
    if j >= K:
      rec[S[j-K]] -= 1
    ans += rec[S_j]
    rec[S_j] += 1
  
  print(ans)

solve()

### FIXED CODE ###

def solve():
  from itertools import accumulate
  from sys import stdin
  
  f_i = stdin
  N, K = map(int, f_i.readline().split())
  A = map(int, f_i.readline().split())
  S = accumulate(a - 1 for a in A)
  S = (0, ) + tuple(s % K for s in S)
  
  rec = {}
  ans = 0
  for j, S_j in enumerate(S):
    if j >= K:
      rec[S[j-K]] -= 1
    if S_j in rec:
      ans += rec[S_j]
      rec[S_j] += 1
    else:
      rec[S_j] =1
  
  print(ans)

solve()
from collections import deque

def num_way(n):
    memo = [0]*(n+1)

    def _fib(n):
        if n <= 1:
            return n
        if memo[n] != 0:
            return memo[n]
        memo[n] = _fib(n-1) + _fib(n-2)
        return memo[n]

    return _fib(n)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if (end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
  	ans *= num_way(end-start)
  	print(ans%1000000007)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if(end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
    ans *= num_way(end-start)
    print(ans%1000000007)
N = input()

for i in range(len(N)):
	if N[i] =='7':
    	print("Yes")
       	exit()

print("No")

### FIXED CODE ###

N = input()
 
for i in range(len(N)):
	if N[i] =='7':
		print("Yes")
		exit()
 
print("No")
from collections import deque
def main():

    s = deque(input())

    

    ans = 0
    while s!=[]:
        if s[0]==s[-1]:
            s.popleft()
            if len(s)>0:
                s.pop()
            else:
                break
            continue
        if s[0]!='x' and s[-1]!='x':
            ans = -1
            break
        if s[0]=='x':
            ans+=1
            s.popleft()
        if s[-1]=='x':
            ans+=1
            s.pop()
    
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

from collections import deque
def main():

    s = deque(input())

    

    ans = 0
    while len(s)>1:
        if s[0]==s[-1]:
            s.popleft()
            s.pop()
            continue
        if s[0]!='x' and s[-1]!='x':
            ans = -1
            break
        if s[0]=='x':
            ans+=1
            s.popleft()
        if s[-1]=='x':
            ans+=1
            s.pop()
    
    print(ans)

if __name__ == "__main__":
    main()
def search(i, visited, ns, ans) :
    #print(i+1)
    visited[i] = True
    for next, weight in ns[i]:
        if visited[next] == False:
            if weight % 2 == 0:
                ans[next] = ans[i]
            else:
                ans[next] = (ans[i]+1) % 2
            search(next, visited, ns, ans)


def dfs(ns, ans):
    visited = [False] * len(ns)
    search(0, visited, ns, ans)

def main():
    n = int(input())
    ns = [[] for _ in range(n)]
    for _ in range(n-1):
        (st,end,weight) = map(int,input().split())
        ns[st-1].append((end - 1,weight))
        ns[end-1].append((st-1,weight))
    ans = [False] * n
    dfs(ns, ans)
    for a in ans:
        if a:
            print(1)
        else:
            print(0)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
def search(i, visited, ns, ans) :
    #print(i+1)
    visited[i] = True
    for next, weight in ns[i]:
        if visited[next] == False:
            if weight % 2 == 0:
                ans[next] = ans[i]
            else:
                ans[next] = (ans[i]+1) % 2
            search(next, visited, ns, ans)


def dfs(ns, ans):
    visited = [False] * len(ns)
    search(0, visited, ns, ans)

def main():
    n = int(input())
    ns = [[] for _ in range(n)]
    for _ in range(n-1):
        (st,end,weight) = map(int,input().split())
        ns[st-1].append((end - 1,weight))
        ns[end-1].append((st-1,weight))
    ans = [False] * n
    dfs(ns, ans)
    for a in ans:
        if a:
            print(1)
        else:
            print(0)

if __name__ == '__main__':
    main()
N=int(input())
X=[*map(int,input().split())]

num=[i+1 for i in range(N)]
l=zip(num,X)
l=sorted(l,key=lambda x:x[1])
indexlist=[]
for i in range(N):
    indexlist.append(l[i][0])
for i in range(N):
    x=indexlist.index(i+1)
    if x<=N//2-1:
        ans=l[N//2][1]
    else:
        ans=l[N//2-1][1]
    print(ans)

### FIXED CODE ###

N=int(input())
X=list(map(int,input().split()))

# Xをソート(Xsort)
# 除く数字が中央より左の場合、答えは中央右(r)の数字
# 逆も然り
Xsort=sorted(X)
l=(N-1)//2
r=l+1
th=Xsort[l]
for i in range(N):
    if X[i]<=th:
        ans=Xsort[r]
    else:
        ans=Xsort[l]
    print(ans)
H,W =map(int,input().split())
h,m =map(int,input().split())
print(H*W-h*W-w*H+h*W)

### FIXED CODE ###

H,W =map(int,input().split())
h,w =map(int,input().split())
print(H*W-h*W-w*H+h*w)
a =int(input())
b =int(input())

print (a*b)
print ((a*2) + (b*2))

### FIXED CODE ###

a,b = [int(i) for i in input().split()]
print(a*b,a+a+b+b)
n = input().split()
ans = int( int(n[2]+0.5) / n[1]   ) * n[1]
print(ans)

### FIXED CODE ###

n = input().split()
ans = int( (int(n[2]) + 0.5) / int(n[0])) * int(n[1])
print(ans)
#D
import sympy
n = int(input())

from functools import lru_cache

@lru_cache
def s(n,gokei):
    if n == 1:
        return gokei+1
    out = len(sympy.divisors(n))*n
    gokei += out
    return s(n-1,gokei)

print(s(n,0))

### FIXED CODE ###

#D
n = int(input())

ans = 0
for i in range(1,n+1):
    tmp = n // i
    ans += tmp * (i + n//i * i) // 2
    
print(ans)
N = int(input())
d = {}
e = [[] for _ in range(N)]
dd = [-1 for _ in range(N)]
for _ in range(N-1):
    u, v, w = list(map(int, input().split()))
    e[u-1].append(v-1)
    e[v-1].append(u-1)
    d[(u-1,v-1)]= d[(v-1,u-1)] = w

def dfs(i, _d):
    dd[i] = _d
    for c in e[i]:
        if dd[c]!=-1: continue
        dfs(c, _d+d[(i,c)])

dfs(0,0)
for _dd in dd:
    print(_dd%2)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N = int(input())
d = {}
e = [[] for _ in range(N)]
dd = [-1]*N
for _ in range(N-1):
    u, v, w = list(map(int, input().split()))
    e[u-1].append(v-1)
    e[v-1].append(u-1)
    d[(u-1,v-1)]= d[(v-1,u-1)] = w

def dfs(i, _d):
    dd[i] = _d
    for c in e[i]:
        if dd[c]!=-1: continue
        dfs(c, _d+d[(i,c)])

dfs(0,0)
for _dd in dd:
    print(_dd%2)
import math
n = int(input())
a = math.sqrt(n)
if int(a)<a:
  a=int(a)+1
else:
  a=int(a)
ans = 0
for i in range(1,a+1):
  if (n-i)%i==0 and n%((n-i)//i)==i:
    ans+=(n-i)//i
print(ans)

### FIXED CODE ###

import math
n = int(input())
a = math.sqrt(n)
if int(a)<a:
  a=int(a)+1
else:
  a=int(a)
ans = 0
for i in range(1,a):
  if (n-i)%i==0 and n%((n-i)//i)==i:
    ans+=(n-i)//i
print(ans)
import numpy as np
h, w = map(int, input().split())

A = []
for i in range(h):
    s = list(input())
    if len(set(s)) == 1 and s[0] == ".":
        continue
    else:
        A.append(s)
B = A
c = 0
for i in range(w):
    s = []
    for j in range(len(A)):
        s.append(A[j][i])
    if len(set(s)) == 1 and s[0] == '.':
        B = np.delete(B, i-c, 1)
        c += 1


for i in B:
    a = ""
    for j in i:
        a += j
    print(a)

### FIXED CODE ###

import numpy as np
h, w = map(int, input().split())

A = []
for i in range(h):
    s = list(input())
    if len(set(s)) == 1 and s[0] == ".":
        continue
    else:
        A.append(s)
B = A
c = 0
for i in range(w):
    s = []
    for j in range(len(A)):
        s.append(A[j][i])
    if len(set(s)) == 1 and s[0] == '.':
        B = np.delete(B, i-c, 1)
        c += 1


for i in B:
    a = ""
    for j in i:
        a += j
    print(a)
a, b, c = map(int, input().split(""))
if a < b and b < c:
 print "Yes"
else:
 print "No"

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
if a < b and b < c:
 print "Yes"
else:
 print "No"
import fractions

from numba import njit
from sys import stdin


@njit
def calc_ans(a, lcm):
    ans = 0

    for ai in a:
        ans += lcm // ai

    ans %= 10 ** 9 + 7

    return ans


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))
    sa = set(a)

    lcm = 1

    for ai in sa:
        lcm = (ai * lcm) // fractions.gcd(ai, lcm)

    print(calc_ans(a, lcm))


if __name__ == "__main__":
    main()


### FIXED CODE ###

import fractions

from sys import stdin


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))
    sa = set(a)

    lcm = 1

    for ai in sa:
        lcm = (ai * lcm) // fractions.gcd(ai, lcm)

    ans = 0

    for ai in a:
        ans += lcm // ai
    ans %= 10 ** 9 + 7

    print(ans)


if __name__ == "__main__":
    main()
import sys
N = input()
TA = input()
T, A = TA.split()
Hinp = input()
H = Hinp.split()
ans = None
for x in range(H):
    _ans = T - x * 0.006
    if _ans == ans:
        print(ans)
        sys.exit()
    if not ans or abs(A - _ans) < abs(A - ans):
        ans = _ans
print(ans)

### FIXED CODE ###

import sys
N = input()
TA = input()
T, A = TA.split()
Hinp = input()
H = Hinp.split()
ansnum = None
ans = 0
def getdiff(A, ans):
    return abs(max(ans, A) - min(ans, A))
def chk(A, _ans, ans):
    new_d, old_d = getdiff(A, _ans), getdiff(A, ans)
    if new_d < old_d:
        return True
    return False
for i, x in enumerate(H):
    _ans = int(T) - int(x) * 0.006
    if _ans == A:
        break
    if not ansnum or chk(int(A), _ans, ansnum):
        ans = i+1
        ansnum = _ans
print(ans)
X,K,D = map(int,input().split())
answer = X
while K > 0 :
  if X > 0 :
    X = X - D
  else :
    X = X + D
  K = K - 1        
  if answer > abs(X) :
    answer = abs(X)  
print(answer)

### FIXED CODE ###

S = list(input())
count = 0
max_count =0
for i in S :
    if(i=='R'):
        count = count + 1
    else :
        if(max_count < count) :
            max_count = count
            count = 0
if(max_count < count) :
    max_count = count

print(max_count)
N = int(input())
D = map(int, input().split())
B = sorted(D)

if B[N/2] == B[(N/2)-1]:
    print(0)
else:
    print(B[N/2]-B[(N/2)-1])

### FIXED CODE ###

N = int(input())
D = list(map(int, input().split()))
B = sorted(D)

if B[int(N/2)] == B[int(N/2)-1]:
    print(0)
else:
    print(B[int(N/2)]-B[int(N/2)-1])
import sys

argvs = sys.argv

if len(argvs) < 2:
    sys.exit(1)

try:
    a = int(argvs[1])
    b = int(argvs[2])
except TypeError:
    sys.exit(1)

if b % a == 0:
    print(a+b)
else:
    print(b-a)


### FIXED CODE ###

a, b = map(int, input().split())

if b % a == 0:
    print(a+b)
else:
    print(b-a)
S=int(input())

for i in range(10**6):
  if int((S+i**2)**(1/2))==(S+i**2)**(1/2):
    y=i
    x=int((S+i**2)**(1/2))
    
print("{} {} {} {} {} {}".format(0,0,x,y,y,x))

### FIXED CODE ###

k=int(input())

print(3*k*k)