# 残問題数 questions = int(input()) if questions >= 7: print((questions - 5)*7 -1) else: print(questions)