version = int(input()) first = 316 diff = 52 print(first + diff * (version - 1))