package main import ( "fmt" ) func main() { var l, k int fmt.Scanf("%d %d", &l, &k) d := (l - 1) / (2 * k) fmt.Println(d * k) }