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