n = gets.chomp.split.map(&:to_i)  
# 今回の変数は1~3なので(1..3)だが n なので(1..n)

# a = 0
# b = 0
# c = 0
count = 0

(1..n).each do |a|
  (1..n).each do |b|
    (1..n).each do |c|
      if [a, b, c].join  # 連結させたい文字列を配列で繋げる
       count += 1      　 
      end
    end
  end
end

puts count

