n = int(input())
x = (n - 1)** 2 
import math

y = x % 12
if y >= 6:
    x = x // 12 + 1
else:
    x = x // 12

print(x % (10 ** 9 + 7))