n = int(input()) ans = 0 while n >= 7: ans += 7 n -= 7 n += 6 ans += n print(ans)