{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
import           Data.IORef
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           System.IO

readT :: Read a => T.Text -> a
readT = read . T.unpack

getLineSpc :: Read a => IO [a]
getLineSpc = do
  t <- T.getLine
  let xs = map readT $ T.split (== ' ') t
  return xs

main :: IO ()
main = remainderReminder

remainderReminder :: IO ()
remainderReminder = do
  nkT :: [Int] <- getLineSpc
  let [n, k] = nkT :: [Int]
  if k /= 0 then do
    m <- newIORef 0
    forM_ [2..n] $ \i -> do
      let (q, r) = n `divMod` i
          add    = q * max 0 (i - k) + max 0 (r - k + 1)
      modifyIORef m (+ add)
    m <- readIORef m
    print m else
    print $ n ^ 2