#!/usr/bin/env python3 #fileencoding: utf-8 N = int(input()) M = int(input()) print(N//M - (N//M % 1000))