Solution to c) (only int)