Let's denote d(n) as the number of divisors of a positive integer n. You are given three integers a, b and c. Your task is to calculate the following sum:

$\sum_{i = 1}^{a} \sum_{j = 1}^{b} \sum_{k = 1}^{c} d(i \cdot j \cdot k)$

Find the sum modulo 1073741824 (2^30).


-----Input-----

The first line contains three space-separated integers a, b and c (1 ≤ a, b, c ≤ 100).


-----Output-----

Print a single integer — the required sum modulo 1073741824 (2^30).


-----Examples-----
Input
2 2 2

Output
20

Input
5 6 7

Output
1520



-----Note-----

For the first example.

  d(1·1·1) = d(1) = 1;  d(1·1·2) = d(2) = 2;  d(1·2·1) = d(2) = 2;  d(1·2·2) = d(4) = 3;  d(2·1·1) = d(2) = 2;  d(2·1·2) = d(4) = 3;  d(2·2·1) = d(4) = 3;  d(2·2·2) = d(8) = 4. 

So the result is 1 + 2 + 2 + 3 + 2 + 3 + 3 + 4 = 20.

Difficulty: interview

Starter code:

Solutions:
a, b, c = map(int, input().split())
d = 1073741824
p = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
t = [{} for i in range(101)]
ans = {}
for i in p:
    j = i
    m = 1
    while j < 101:
        for k in range(j, 101, j):
            t[k][i] = m
        j = j * i
        m += 1
s = 0
for i in range(1, a + 1):
    for j in range(1, b + 1):
        q = {}
        for x in t[i].keys() | t[j].keys():
            q[x] = t[i].get(x, 0) + t[j].get(x, 0)
        ij = i * j
        for k in range(1, c + 1):
            ijk = ij * k
            if ijk in ans: s += ans[ijk]
            else:
                y = 1
                for x in q.keys() | t[k].keys():
                    y = y * (q.get(x, 0) + t[k].get(x, 0) + 1)
                ans[ijk] = y
                s += y

print(s)

def main():
    from itertools import product
    a, b, c = sorted(map(int, input().split()))
    primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97)
    l = [None]
    for x in range(1, (c + 1)):
        tmp = [0] * 25
        for i, p in enumerate(primes):
            while not x % p:
                x //= p
                tmp[i] += 1
        l.append(tuple(tmp))
    res = 0
    cache = {}
    for x, y, z in product(list(range(1, a + 1)), list(range(1, b + 1)), list(range(1, c + 1))):
        xyz = x * y * z
        if xyz in cache:
            res += cache[xyz]
        else:
            u = 1
            for t in map(sum, list(zip(l[x], l[y], l[z]))):
                if t:
                    u *= t + 1
            u &= 1073741823
            cache[xyz] = u
            res += u
    print(res & 1073741823)


def __starting_point():
    main()

__starting_point()

from functools import reduce
def main():
    from itertools import product
    from functools import reduce
    from operator import mul
    a, b, c = sorted(map(int, input().split()))
    primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97)
    l = [None]
    for x in range(1, (c + 1)):
        tmp = [0] * 25
        for i, p in enumerate(primes):
            while not x % p:
                x //= p
                tmp[i] += 1
        l.append(tuple(tmp))
    res = 0
    cache = {}
    for x, y, z in product(list(range(1, a + 1)), list(range(1, b + 1)), list(range(1, c + 1))):
        xyz = x * y * z
        if xyz in cache:
            res += cache[xyz]
        else:
            cache[xyz] = u = (
                reduce(mul, list(map(sum, list(zip(
                    l[x], l[y], l[z], (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))))),
                       1) & 1073741823)
            res += u
    print(res & 1073741823)

def __starting_point():
    main()

__starting_point()

def main():
    from itertools import product
    a, b, c = sorted(map(int, input().split()))
    primes = [p for p in (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
                          47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97) if p <= c]
    l = [None]
    for x in range(1, (c + 1)):
        tmp = [0] * len(primes)
        for i, p in enumerate(primes):
            while not x % p:
                x //= p
                tmp[i] += 1
        l.append(tuple(tmp))
    res = 0
    cache = {}
    for x, y, z in product(list(range(1, a + 1)), list(range(1, b + 1)), list(range(1, c + 1))):
        xyz = x * y * z
        if xyz in cache:
            res += cache[xyz]
        else:
            u = 1
            for t in [_f for _f in map(sum, list(zip(l[x], l[y], l[z]))) if _f]:
                u *= t + 1
            cache[xyz] = u = u & 1073741823
            res += u
    print(res & 1073741823)


def __starting_point():
    main()

__starting_point()

MOD = 1073741824
(a, b, c) = list(map(int, input().split(' ')))

maxProd = a * b * c
d = [0 for i in range(maxProd + 1)]
d[1] = 1

for i in range(2, maxProd + 1):
    d[i] = 2

for i in range(2, maxProd//2 + 1):
    for j in range(2 * i, maxProd + 1, i):
        d[j] += 1

ret = 0
for i in range(1, a + 1):
    for j in range(1, b + 1):
        for k in range(1, c + 1):
            ret = (ret + d[i * j * k]) % MOD

print(ret)


#236B

import math

arr = list(map(int, input().split(" ")))
a = arr[0]
b = arr[1]
c = arr[2]

d = dict()

def numdiv(n):
	if n in d:
		return d[n]
	else:
		count = 0
		for i in range(1, int(math.sqrt(n) + 1)):
			if n % i == 0:
				count += 2
		if int(math.sqrt(n)) * int(math.sqrt(n)) == n:
			count -= 1
		d[n] = count
		return count

answer = 0
for i in range(1, a + 1):
	for j in range(1, b + 1):
		for k in range(1, c + 1):
			answer += numdiv(i * j * k)

print(answer)

a,b,c=input().split()
a,b,c=[int(a),int(b),int(c)]
s=0
d=[0]*(1000001)
for i in range(1,1000001):
    j=i
    while j<=1000000:
        d[j]+=1
        j+=i
for i in range(1,a+1):
    for j in range(1,b+1):
        for k in range(1,c+1):
            p=(i*j*k)
            s+=d[p]
print(s)

from fractions import gcd
a,b,c=list(map(int,input().split()))
ans=0
mod=1073741824
div=[0]*(1000001)
for i in range (1,1000001):
    j=i
    while j<=1000000:
        div[j]+=1
        j+=i
for i in range (1,a+1):
    for j in range (1,b+1):
        for k in range (1,c+1):
            ans+=div[i*j*k]
print(ans%mod)

def primes1(n):
    """ Returns  a list of primes < n """
    sieve = [True] * (n//2)
    for i in range(3,int(n**0.5)+1,2):
        if sieve[i//2]:
            sieve[i*i//2::i] = [False] * ((n-i*i-1)//(2*i)+1)
    return [2] + [2*i+1 for i in range(1,n//2) if sieve[i]]


def d(x):
    y=0
    ans=1
    for i in primes_list:
        if x < i:
            break
        y=1
        while x%i==0 and x>= i:
            x/=i
            y+=1
        ans*=y
    return ans


primes_list = primes1(100)
x = 0
t = {}
a, b, c = list(map(int, input().split()))
s = []
for i in range(1, a+1):
    for j in range(1, b+1):
        for k in range(1, c+1):
            q = i * j * k
            if q not in t:
                t[q] = d(q)
            x += t[q]
print(x % 1073741824)


p= [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
def d(x):
    y=0
    ans=1
    for i in p:
        if x < i:
            break
        y=1
        while x%i==0 and x>= i:
            x/=i
            y+=1
        ans*=y
    return ans
a,b,c=list(map(int,input().split()))
out=0
q={}
for i in range(1,a+1) :
    for j in range(1,b+1) :
        for k in range(1,c+1) :
            e=i*j*k
            if e not in q :
                q[e]=d(e)
            out+=q[e]
print(out % 1073741824)


from collections import Counter


def factors(n):
    fact = Counter()

    i = 2
    while i * i <= n:
        while n % i == 0:
            fact[i] += 1
            n //= i
        i += 1

    if n != 1:
        fact[n] += 1

    fact[1] = 1

    return fact


def solve(a, b, c):
    fact = {i: factors(i) for i in range(1, max(a, b, c) + 1)}

    ans = 0
    cache = {}
    for i in range(1, a+1):
        for j in range(1, b+1):
            for k in range(1, c+1):
                p = i * j * k
                if p not in cache:
                    f = fact[i] + fact[j] + fact[k]
                    f[1] = 1
                    res = 1
                    for k, v in list(f.items()):
                        res *= v + 1
                    
                    cache[p] = res // 2

                ans += cache[p]

    return ans % 1073741824


def main():
    a, b, c = list(map(int, input().split()))
    ans = solve(a, b, c)
    print(ans)


def __starting_point():
    main()

__starting_point()

p = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
def divs(n):
    res = 1
    pos = 0
    while n > 1:
        while pos < len(p) and n % p[pos] != 0:
            pos += 1
        if n > 1 and pos >= len(p):
            res *= 2
            break
        cnt = 0
        while n % p[pos] == 0:
            cnt += 1
            n //= p[pos]
        res *= (cnt+1)
        pos += 1
    return res


d = {}
a, b, c = map(int, input().split())
res = 0
for i in range(1, a+1):
    for j in range(1, b+1):
        for k in range(1, c+1):
            val = i*j*k
            if val not in d:
                d[val] = divs(val)
            res = (res + d[val]) % 1073741824
print(res)

mod = (1 << 30)
memo = dict()

def dp(x):
	if x in memo:
		return memo[x]
	res, q, t = 1, 2, x
	while q * q <= x:
		r = 1
		while x % q == 0:
			x /= q
			r += 1
		res = (res * r) % mod
		q += 1
	if x > 1:
		res = (res * 2) % mod
	memo[t] = res
	return res

a, b, c = sorted(map(int, input().split()))
res = 0
for i in range(1, a+1):
	for j in range(1, b+1):
		for k in range(1, c+1):
			res = (res + dp(i * j * k)) % mod
print(res)


import math
import itertools
import operator


primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
          31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
          73, 79, 83, 89, 97]


def get_prime_mult(n):
    m = [0] * 25
    if n < 2:
        return m
    sq = int(math.sqrt(n))
    p = 0
    while primes[p] <= sq:
        if n % primes[p] != 0:
            p += 1
        else:
            m[p] += 1
            n //= primes[p]
            sq = int(math.sqrt(n))

    m[primes.index(n)] += 1
    return m


a, b, c = list(map(int, input().split()))
mtab = []
for i in range(max((a, b, c)) + 1):
    mtab.append(get_prime_mult(i))

total = 0
mults_cnt = {}
for i in range(1, a + 1):
    for j in range(1, b + 1):
        for k in range(1, c + 1):
            if i * j * k not in mults_cnt:
                mults = [sum(triple) + 1 for triple in zip(mtab[i], mtab[j], mtab[k])]
                mults_cnt[i * j * k] = list(itertools.accumulate(mults, operator.mul))[-1]
            total += mults_cnt[i * j * k]

print(total & 0x3FFFFFFF)


from operator import mul
from functools import reduce
from collections import Counter

a, b, c = list(map(int, input().split()))
mod = 2 ** 30

prime = [None] * 100

for i in range(2, 101):
    if prime[i - 1] is None:
        for j in range(i, 101, i):
            prime[j - 1] = i


d = {}
result = 0
for ai in range(1, a + 1):
    for bi in range(1, b + 1):
        for ci in range(1, c + 1):
            n = ai * bi * ci
            res = d.get(n)

            if res is None:
                cd = Counter()

                n_ai = ai
                while prime[n_ai - 1] is not None:
                    cd[prime[n_ai - 1]] += 1
                    n_ai //= prime[n_ai - 1]
                
                n_bi = bi
                while prime[n_bi - 1] is not None:
                    cd[prime[n_bi - 1]] += 1
                    n_bi //= prime[n_bi - 1]
                
                n_ci = ci
                while prime[n_ci - 1] is not None:
                    cd[prime[n_ci - 1]] += 1
                    n_ci //= prime[n_ci - 1]
                
                res = reduce(mul, [x + 1 for x in list(cd.values())], 1)
                d[n] = res
            
            result += res

print(result % mod)


import math as mt 
import sys,string,bisect
input=sys.stdin.readline
from collections import deque
L=lambda : list(map(int,input().split()))
Ls=lambda : list(input().split())
M=lambda : list(map(int,input().split()))
I=lambda :int(input())
# Python3 program to count  
# number of factors 
# of an array of integers
a,b,c=M()
MAX = (a*b*c)+1; 
  
# array to store 
# prime factors 
factor = [0]*(MAX + 1); 
  
# function to generate all  
# prime factors of numbers 
# from 1 to 10^6 
def generatePrimeFactors(): 
    factor[1] = 1; 
  
    # Initializes all the  
    # positions with their value. 
    for i in range(2,MAX): 
        factor[i] = i; 
  
    # Initializes all  
    # multiples of 2 with 2 
    for i in range(4,MAX,2): 
        factor[i] = 2; 
  
    # A modified version of  
    # Sieve of Eratosthenes 
    # to store the smallest  
    # prime factor that divides 
    # every number. 
    i = 3; 
    while(i * i < MAX): 
        # check if it has 
        # no prime factor. 
        if (factor[i] == i): 
            # Initializes of j  
            # starting from i*i 
            j = i * i; 
            while(j < MAX):  
                # if it has no prime factor  
                # before, then stores the  
                # smallest prime divisor 
                if (factor[j] == j): 
                    factor[j] = i; 
                j += i; 
        i+=1; 
         
# function to calculate 
# number of factors 
def calculateNoOFactors(n): 
    if (n == 1): 
        return 1; 
    ans = 1; 
  
    # stores the smallest  
    # prime number that 
    # divides n 
    dup = factor[n]; 
  
    # stores the count of  
    # number of times a  
    # prime number divides n. 
    c = 1; 
  
    # reduces to the next  
    # number after prime 
    # factorization of n 
    j = int(n / factor[n]); 
  
    # false when prime  
    # factorization is done 
    while (j > 1): 
        # if the same prime  
        # number is dividing  
        # n, then we increase 
        # the count 
        if (factor[j] == dup): 
            c += 1 
  
        # if its a new prime factor 
        # that is factorizing n,  
        # then we again set c=1 and  
        # change dup to the new prime  
        # factor, and apply the formula  
        # explained above.  
        else: 
            dup = factor[j] 
            ans = ans * (c + 1) 
            c = 1
  
        # prime factorizes 
        # a number 
        j = int(j / factor[j])
  
    # for the last 
    # prime factor 
    ans = ans * (c + 1); 
  
    return ans 
d=[0]*(a*b*c+1)
generatePrimeFactors()
'''for i in range(1,MAX):
    d.append(calculateNoOFactors(i))'''
x=0

for i in range(1,a+1):
    for j in range(1,b+1):
        for k in range(1,c+1):
            if(d[i*j*k]==0):
                d[i*j*k]=calculateNoOFactors(i*j*k)
            x+=d[i*j*k]%1073741824
print(x%1073741824)
            


mod = (1 << 30)
memo = dict()
 
def dp(x):
	if x in memo:
		return memo[x]
	res, q, t = 1, 2, x
	while q * q <= x:
		r = 1
		while x % q == 0:
			x /= q
			r += 1
		res = (res * r) % mod
		q += 1
	if x > 1:
		res = (res * 2) % mod
	memo[t] = res
	return res
 
a, b, c = sorted(map(int, input().split()))
res = 0
for i in range(1, a+1):
	for j in range(1, b+1):
		for k in range(1, c+1):
			res = (res + dp(i * j * k)) % mod
print(res)

p= [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
def d(x):
    y=0
    ans=1
    for i in p:
        if x < i:
            break
        y=1
        while x%i==0 and x>= i:
            x/=i
            y+=1
        ans*=y
    return ans
a,b,c=list(map(int,input().split()))
out=0
q={}
for i in range(1,a+1) :
    for j in range(1,b+1) :
        for k in range(1,c+1) :
            e=i*j*k
            if e not in q :
                q[e]=d(e)
            out+=q[e]
print(out % 1073741824)


a,b,c=[int(x) for x in input().split(' ')]
mod=1073741824

def divisors(x):
	powers={}
	i=2
	while(x!=1):
		if x%i==0:
			if i in powers:
				powers[i]+=1
			else:
				powers[i]=1
			x//=i
		else:
			i+=1
	return powers

primeFactors={}

for x in range(1,101):
	primeFactors[x]=divisors(x)

def finalMapPrepare(finalMap,x):
	for k in primeFactors[x]:
		if k in finalMap:
			finalMap[k]+=primeFactors[x][k]
		else:
			finalMap[k]=primeFactors[x][k]
		
total=0
for i in range(1,a+1):
	for j in range(1,b+1):
		for k in range(1,c+1):
			finalMap={}
			finalMapPrepare(finalMap,i)
			finalMapPrepare(finalMap,j)
			finalMapPrepare(finalMap,k)
			ans=1
			for v in finalMap.values():
				ans*=(v+1)
			total+=(ans)%mod
print(total%mod)

a,b,c=[int(x) for x in input().split(' ')]
mod=1073741824
divisors=[1]*1000001
for x in range(2,1000001):
	for y in range(x,1000001,x):
		divisors[y]+=1
ans=0
for i in range(1,a+1):
	for j in range(1,b+1):
		for k in range(1,c+1):
			ans+=(divisors[i*j*k])%mod
print(ans%mod)