1. 
/** * FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* * Problem: 913 - Joana and the Odd Numbers
* * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=854
* * Savkina Ekaterina
* * @version 1.0, 29/04/2010
* * Status : Accepted
* * Runtime: 0.128 */
package odd;

import java.math.BigInteger;
import java.util.Scanner;

public class Odd {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
BigInteger sum = new BigInteger("0");
while (sc.hasNext()) {
int count = sc.nextInt();
if (count == 0)
System.out.println(1);
else {
count = count / 2 + 1;
BigInteger co = BigInteger.valueOf(count);
sum = co.add(BigInteger.ONE).multiply(co).subtract(co)
.multiply(BigInteger.valueOf(2)).subtract(
BigInteger.ONE).multiply(BigInteger.valueOf(3))
.subtract(BigInteger.valueOf(6));
System.out.println(sum);
}
}
}
}