int amountPicture = 52; int pictureInRow = 3; int fullRow; int extra; fullRow = amountPicture / pictureInRow; extra = amountPicture - fullRow * pictureInRow; Console.WriteLine(fullRow); Console.WriteLine(extra);