#!/bin/ruby def sumOfGroup(k) return k*(((k*(k-1)))+1)+((k*(k-1))) end k = gets.strip.to_i answer = sumOfGroup(k) puts answer