package main
import (
"fmt"
)
func main() {
// Define the limit
limit := 999
// Calculate the upper bounds
upperForThree := limit / 3
upperForFive := limit / 5
upperForFifteen := limit / 15
// Calculate the sums using arithmetic series formula
sumThree := 3 * upperForThree * (1 + upperForThree) / 2
sumFive := 5 * upperForFive * (1 + upperForFive) / 2
sumFifteen := 15 * upperForFifteen * (1 + upperForFifteen) / 2
// Calculate the total sum
totalSum := sumThree + sumFive - sumFifteen
fmt.Println(totalSum)
}
/*
run:
233168
*/