int n = 0;

for (int i = 0; i < 4; i++) {
    n += i*i;
}

System.out.println(n);