HackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly $5$ people on social media. 

On the first day, half of those $5$ people (i.e., $floor(\frac{5}{2})=2$) like the advertisement and each shares it with $3$ of their friends. At the beginning of the second day, $floor(\frac{5}{2})\times3=2\times3=6$ people receive the advertisement. 

Each day, $floor(\frac{recipients}{2})$ of the recipients like the advertisement and will share it with $3$ friends on the following day.  Assuming nobody receives the advertisement twice, determine how many people have liked the ad by the end of a given day, beginning with launch day as day $\mbox{1}$.

Example 

$n=5$. 

Day Shared Liked Cumulative
1      5     2       2
2      6     3       5
3      9     4       9
4     12     6      15
5     18     9      24

The progression is shown above.  The cumulative number of likes on the $5^{th}$ day is $24$.  

Function Description  

Complete the viralAdvertising function in the editor below.    

viralAdvertising has the following parameter(s):  

int n: the day number to report  

Returns  

int: the cumulative likes at that day   

Input Format

A single integer, $n$, the day number.

Constraints

$1\leq n\leq50$

Sample Input
3

Sample Output
9

Explanation

This example is depicted in the following diagram:  

$2$ people liked the advertisement on the first day, $3$ people liked the advertisement on the second day and $4$ people liked the advertisement on the third day, so the answer is $2+3+4=9$.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
people = 5
total = 0
n = int(input())
for i in range(n):
	receive = int(people / 2)
	total += receive
	people = receive * 3
print(total)


n = int(input())
k = 5
total = 0
for i in range(n):
	total += k // 2
	k = k // 2 * 3
print(total)


import math
n = int(input().strip())
total = 0
count = 5
day = 0
while day < n:
	count = math.floor(count / 2)
	total += count
	count *= 3
	day += 1
print(total)


import math
n = int(input())
res = 0
m = 5
while n > 0:
	fl = math.floor(m / 2)
	res += fl
	m = fl * 3
	n -= 1
print(res)


i = int(input())
v = 5
p = 0
for k in range(1, i + 1):
	p += int(v / 2)
	v = int(v / 2) * 3
print(p)


days = int(input())
people = 5
result = 0
for i in range(days):
	people = people // 2
	result += people
	people *= 3
print(result)


import math
a = 5
n = int(input())
su = 0
for i in range(0, n, 1):
	su = su + math.floor(a / 2)
	a = math.floor(a / 2) * 3
print(int(su))


import math
n = int(input())
previous_people = 5
previous_liked = 0
total_liked = 0
for i in range(1, n + 1):
	new_liked = math.floor(previous_people / 2.0)
	total_liked += new_liked
	previous_people = new_liked * 3
print(total_liked)


n = int(input().strip(''))
i = 0
li = []
li.append(5)
like = []
like.append(2)
while i < n - 1:
	x = int(li[i] / 2) * 3
	li.append(x)
	i = i + 1
l = 0
for x in li:
	l += int(x / 2)
print(l)


import math
n = int(input())
current_day = 1
current_total = 5
current_likes = 2
next_total = 6
total_likes = current_likes
while current_day < n and current_total > 0:
	current_day = current_day + 1
	current_total = next_total
	current_likes = math.floor(current_total / 2)
	total_likes = total_likes + current_likes
	next_total = current_likes * 3
print(total_likes)


n = int(input())
x = 5
ans = 0
while n > 0:
	x = x // 2
	ans += x
	x *= 3
	n -= 1
print(ans)


n = int(input())
k = 5
people_like = 0
people_like_total = 0
for i in range(n):
	people_like = int(k / 2)
	people_like_total += people_like
	k = people_like * 3
print(people_like_total)


n = int(input())
see = 0
like = 5 // 2
temp = like
for i in range(n - 1):
	see = temp * 3
	like = like + see // 2
	temp = see // 2
print(like)


r = 0
n = 5
for _ in range(int(input())):
	r += n // 2
	n = 3 * (n // 2)
print(r)


import math
input_str = input()
try:
	nbr = int(input_str)
except:
	print('An exception occurred while parsing input as integer.')
if nbr <= 0 or nbr >= 51:
	print('Bad input specified')
result = 0
people = 5
for day in range(1, nbr + 1):
	half = math.floor(people / 2)
	result += half
	people = 3 * half
print(result)


import math
n = int(input())
people = 2
people1 = 5
for x in range(2, n + 1):
	people = people + math.floor(math.floor(math.floor(people1 / 2) * 3) / 2)
	people1 = math.floor(people1 / 2) * 3
if n != 1:
	print(people)
else:
	print('5')


import math
days = int(input())
friends = 5
res = 0
for i in range(days):
	friends = math.floor(friends / 2)
	res += friends
	friends = friends * 3
print(str(int(res)))


import sys
for line in sys.stdin:
	n = int(line)
m = 5
total = 0
for i in range(n):
	likes = m // 2
	shares = likes * 3
	m = shares
	total += likes
print(total)


n = int(input())
start = 5
peopleLiked = 0
for i in range(n):
	likes = int(start / 2)
	peopleLiked += likes
	start = likes * 3
print(peopleLiked)


def main():
	n = int(input())
	val = 5
	res = val // 2
	for _ in range(2, n + 1):
		val = val // 2 * 3
		res += val // 2
	print(res)
main()


n = int(input())
summ = 2
viral = 2
for day in range(2, n + 1):
	viral = viral * 3 // 2
	summ += viral
print(summ)


a = int(input())

def num_people_like(a):
	counter = 0
	result = [2]
	while counter < a - 1:
		result.append(result[-1] * 3 // 2)
		counter += 1
	return sum(result)
print(num_people_like(a))


d = int(input())
p = 5
count = 0
for x in range(d):
	p = p // 2
	count += p
	p = p * 3
print(count)


n = int(input())
s = 0
c = 5
for i in range(n):
	c //= 2
	s += c
	c *= 3
print(s)


n = int(input())
m = 5
likes = 0
for __ in range(n):
	likes += m // 2
	m = m // 2 * 3
print(likes)


n = int(input())
total = 0
st = 5
for _ in range(n):
	total += st // 2
	st = st // 2 * 3
print(total)


n = int(input())
nodes = 2
tot = 2
for i in range(2, n + 1):
	nodes *= 3
	liked = nodes // 2
	tot += liked
	nodes = liked
print(tot)


n = int(input())
a = [2]
from math import floor
for i in range(0, 49):
	a.append(floor(a[i] * 3 / 2))
print(sum(a[:n]))


import math
n = int(input())
count = 2
total = 2
for i in range(1, n):
	count = math.floor(3 * count / 2)
	total += count
print(total)


n = int(input())
s = 0
t = 2
for i in range(n):
	s += t
	t = int(t * 3 / 2)
print(s)


n = int(input().strip())
active = 5
sum = 0
for i in range(n - 1):
	active //= 2
	sum += active
	active *= 3
active //= 2
sum += active
print(sum)


from math import floor
import sys
n = int(sys.stdin.readline())
start = 5
tot = 0
for i in range(n):
	nxt = floor(start / 2.0)
	tot += nxt
	start = nxt * 3
print(tot)


import math
n = int(input())
s = 0
a = math.floor(5 / 2)
for i in range(n):
	s += a
	a = math.floor(a * 3 / 2)
print(s)


n = int(input())
share = 3
today = 5
count = 0
for _ in range(n):
	(today, tomorrow) = (today // 2, today // 2 * 3)
	count += today
	today = tomorrow
print(count)


receivers = 5
total_likes = 0
days = int(input())
for day in range(days):
	likes = receivers // 2
	total_likes += likes
	receivers = receivers // 2 * 3
print(total_likes)


n = int(input())
x = 2
total = 2
for i in range(1, n):
	x = x * 3 // 2
	total += x
print(total)


import sys
import math
n = int(input().strip())
seen = 5
sumseen = 0
for _ in range(n):
	seen = math.floor(seen / 2)
	sumseen += seen
	seen *= 3
print(sumseen)


n = int(input())
answer = 0
people = 5
for _ in range(n):
	answer += people // 2
	people = people // 2 * 3
print(answer)


n = int(input())
ans = 0
cur = 5
for i in range(n):
	ans += cur // 2
	cur = cur // 2 * 3
print(ans)


import math
n = int(input()) - 1
(c, x) = (2, 2)
while n != 0:
	x = 3 * x // 2
	c += x
	n -= 1
print(c)


import sys
import math
n = int(sys.stdin.readline().split(' ')[0].rstrip('\n'))
start = 5
liked = math.floor(start / 2)
for i in range(1, n):
	start = math.floor(start / 2) * 3
	liked += math.floor(start / 2)
print(liked)


n = int(input().strip())
if n == 1:
	print(2)
else:
	x = 1
	t = 2
	l = 2
	while x < n:
		x += 1
		(t, l) = (t + l * 3 // 2, l * 3 // 2)
	print(t)


days = int(input())
each_day = 5
total = 2
for i in range(1, days):
	each_day = each_day // 2 * 3
	total += each_day // 2
print(total)


n = int(input())
start = 5
num = 0
for i in range(0, n):
	num += start // 2
	start = start // 2 * 3
print(num)


n = int(input())
people = 2
likes = 2
for i in range(1, n):
	people = people * 3
	likes += int(people / 2)
	people = int(people / 2)
print(likes)


res = 0
people = 5
for i in range(int(input())):
	res += people // 2
	people = people // 2 * 3
print(res)


n = int(input())
i = 0
line = [2]
for i in range(n):
	line.append(int(round(line[i] * 3 // 2)))
print(int(sum(line[:n])))


import math
n = int(input().strip())
i = 0
m = 5
liked = 0
while i < n:
	t = math.floor(m / 2)
	m = t * 3
	i += 1
	liked += t
print(liked)


import math
m = int(input())
x = 5
liked = math.floor(5 / 2)
receive_next_day = math.floor(x / 2) * 3
for e in range(m - 1):
	liked = liked + math.floor(receive_next_day / 2)
	receive_next_day = math.floor(receive_next_day / 2) * 3
print(liked)


import math
days = int(input())
m = 5
answer = 0
for i in range(1, days + 1):
	answer += math.floor(m / 2.0)
	m = math.floor(m / 2.0) * 3
print(answer)


n = int(input())
flag = 5
count = 0
day = []
for i in range(n):
	day.append(flag // 2)
	flag = flag // 2 * 3
print(sum(day))


import math
n = int(input())
t = 5
count = 0
for i in range(n):
	count = count + math.floor(t / 2)
	t = math.floor(t / 2) * 3
print(count)


N = int(input().strip())
X = 5 // 2
P = 2
for _ in range(N - 1):
	X = X * 3
	X = X // 2
	P += X
print(P)


import sys
import math
n = int(input().strip())
count = 0
m = 5
for i in range(n):
	like = math.floor(m / 2)
	count = count + like
	m = 3 * like
print(count)


curr_recieved = 5
n = int(input())
tot_like = 0
for x in range(1, n + 1):
	curr_like = curr_recieved // 2
	tot_like += curr_like
	curr_recieved = curr_like * 3
print(tot_like)


t = int(input())
s = 0
w = 5
for i in range(t):
	w //= 2
	s += w
	w *= 3
print(s)


import sys

def totalLikes(n):
	nSent = 5
	likes = 0
	for _ in range(n):
		newLikes = nSent // 2
		nSent = newLikes * 3
		likes += newLikes
	return likes
print(totalLikes(int(sys.stdin.read().strip())))


n = int(input())
liked = 0
size = 5
for _ in range(n):
	liked += size // 2
	size = size // 2 * 3
print(liked)


import math
n = int(input())
curr = 5
total = 0
for _ in range(n):
	curr = math.floor(curr / 2)
	total += curr
	curr = curr * 3
print(total)


startNum = 5
sum = 0
n = input()
for i in range(int(n)):
	sum = sum + startNum // 2
	startNum = startNum // 2 * 3
print(sum)


from math import floor
total = 0
num = 5
for i in range(int(input())):
	total += floor(num / 2.0)
	num = floor(num / 2.0) * 3
print(total)


import math
m = 5
p = 2
n = int(input())
for i in range(n - 1):
	m = math.floor(m / 2) * 3
	p += math.floor(m / 2)
print(p)


days = int(input())
likes = 0
recipients = 5
for day in range(days):
	daily_likes = recipients // 2
	likes += daily_likes
	recipients = daily_likes * 3
print(likes)


n = int(input())
s = t = 2
for i in range(1, n):
	t += int(t / 2)
	s += t
print(s)


n = input()
s = 5
people = s // 2
for i in range(1, int(n)):
	s = s // 2 * 3
	people += s // 2
print(people)


n = int(input())
count = 0
m = 5
for i in range(n):
	liked = m >> 1
	count += liked
	m = 3 * liked
print(count)


import math
n = int(input())

def funct(i):
	return (math.floor(i / 2), math.floor(i / 2) * 3)
total_liked = 0
shared = 5
for i in range(n):
	(liked, shared) = funct(shared)
	total_liked += liked
print(total_liked)


n = int(input().strip())
people = 5
soma = 0
for i in range(n):
	people //= 2
	soma += people
	people *= 3
print(soma)


n = int(input())
s = 2
a = 2
if n == 1:
	print('2')
else:
	for i in range(2, n + 1):
		a = a * 3 // 2
		s = s + a
	print(s)


import math

def count(n):
	L = [5]
	sum = 0
	for i in range(1, n + 1):
		sum += math.floor(L[-1] / 2)
		L.append(math.floor(L[-1] / 2) * 3)
	return sum
k = int(input())
print(count(k))


n = int(input().strip())
m = 5
t = 2
for _ in range(n - 1):
	m = int(m / 2) * 3
	t += int(m / 2)
print(t)


import sys
from math import floor
n = int(input().strip())
rec = 5
sum = 0
for i in range(1, n + 1):
	rec = floor(rec / 2)
	sum += rec
	rec *= 3
print(sum)


import sys
n = int(input())
current = 2
res = 2
for i in range(n - 1):
	current = current * 3 // 2
	res += current
print(res)


import math
n = int(input())
p = 5
total = 0
for i in range(n):
	p = math.floor(p / 2)
	total = total + p
	p = p * 3
print(total)


import math
c = input().split()
counter = int(c[0])
totalLikes = 0
currentPeople = 5
while counter > 0:
	temp = math.floor(currentPeople / 2)
	totalLikes = totalLikes + temp
	currentPeople = temp * 3
	counter -= 1
print(totalLikes)


n = int(input().strip())
total_liked = 0
shared = 5
for i in range(n):
	liked = shared // 2
	total_liked += liked
	shared = liked * 3
print(total_liked)


days = int(input())
total = 0
current = 2
for i in range(days):
	total += current
	current = current * 3 // 2
print(total)


n = int(input().strip())
ini = 5
lk = 0
for i in range(n):
	ini = ini // 2
	lk += ini
	ini *= 3
print(lk)


n = int(input())
x = 5
summ = 0
for i in range(1, n + 1):
	summ += x // 2
	x = 3 * (x // 2)
print(summ)


n = int(input())
watched = []
watched.append(5)
count = []
for i in range(1, n + 1):
	count.append(watched[i - 1] // 2)
	watched.append(watched[i - 1] // 2 * 3)
print(sum(count))


from math import floor

def advertise(i):
	if i == 1:
		return floor(5 / 2)
	else:
		return floor(advertise(i - 1) * 3 / 2)
a = int(input().strip())
sum = 0
for i in range(1, a + 1):
	sum = sum + advertise(i)
print(sum)


n = int(input())
(cur, total) = (5, 0)
for _ in range(n):
	cur = int(cur / 2)
	total += cur
	cur = cur * 3
print(total)


m = 5
n = int(input())
ans = 0
for i in range(n):
	ans += m // 2
	m = m // 2 * 3
print(ans)


import sys
n = int(input().strip())
count = 0
m = 5
while n:
	m = m // 2
	count += m
	m *= 3
	n -= 1
print(count)


def num_likes(n):
	if n is None:
		return None
	n = int(n)
	if n < 1:
		return None
	likes = 2
	i = 1
	total_likes = likes
	while i < n:
		likes = int(3 * likes / 2)
		total_likes += likes
		i += 1
	return total_likes
n = input()
print(num_likes(n))


days = int(input())
share = 5
total = 0
for i in range(days):
	like = share // 2
	total += like
	share = like * 3
print(total)


n = int(input())
liked = 0
people = 5
for _ in range(n):
	people //= 2
	liked += people
	people *= 3
print(liked)


from math import ceil, floor
n = int(input())
cnt = 0
m = 5
for i in range(n):
	cnt += floor(m / 2)
	m = floor(m / 2) * 3
print(cnt)


def solution():
	n = int(input().strip())
	newPeople = 0
	total = 0
	for i in range(0, n):
		if i == 0:
			newPeople = 2
			total += 2
		else:
			newPeople *= 3
			total += newPeople // 2
			newPeople //= 2
	print(total)
solution()


import math
n = int(input())
aud = 5
res = 0
for i in range(n):
	likes = math.floor(aud / 2)
	res += likes
	aud = likes * 3
print(res)


from math import floor
totalLiked = 0
currentLiked = 2
currentSeen = 5
days = int(input())
for i in range(days):
	currentLiked = floor(currentSeen / 2)
	totalLiked += currentLiked
	currentSeen = currentLiked * 3
print(totalLiked)


from math import floor
layers = [2]
days = int(input())
for day in range(days - 1):
	new = layers[-1] * 3
	sharing = floor(new / 2)
	layers.append(sharing)
print(sum(layers))


n = int(input())
shares = 5
likes = 0
for days in range(n):
	likes += int(shares / 2)
	shares = int(shares / 2) * 3
print(likes)


import math
n = int(input())
seed = math.floor(5 / 2)
sum = seed
for i in range(1, n):
	seed = math.floor(seed * 3 / 2)
	sum += seed
print(sum)


from math import floor
day = int(input())
people = 5
nlikes = 0
for _ in range(day):
	liked = floor(people / 2)
	nlikes += liked
	people = liked * 3
print(nlikes)


from math import floor

def viral(days, initial_people=5):
	likes = 0
	for _ in range(days):
		people_liked = floor(initial_people / 2)
		likes += people_liked
		initial_people = people_liked * 3
	return likes
days = int(input())
print(viral(days))


import math
n = int(input().strip())
totalNumOfPeople = 0
dayStartPeople = 5
for _ in range(n):
	curDayPeople = math.floor(dayStartPeople / 2)
	totalNumOfPeople += curDayPeople
	dayStartPeople = curDayPeople * 3
print(totalNumOfPeople)


n = int(input())
sum = 0
a = 5
for i in range(n):
	a //= 2
	sum += a
	a *= 3
print(sum)


n = int(input())
new = 5
ret = 0
for i in range(n):
	liked = new // 2
	ret += liked
	new = liked * 3
print(ret)