n = int(input())#天天百貨商品每滿兩千折兩百,琪琪百貨則是以商品每滿一千折一百的優惠b = 0a = 0if n >= 2000: b = (n // 2000) * 200if n >= 1000: a = (n // 1000) * 100if b == a: print(n-b, 0) # 相同選天天elif n-b < n-a: print(n-b, 0) # 天天百貨價格更低else: print(n-a, 1)