#!/usr/bin/env python3

import sys
import math

MULT=(1/1.5e6)
DIV=666

def main():
    ns_raw = int(sys.argv[1])
    ns_cor = math.ceil(math.ceil((ns_raw * 1000) / DIV) * MULT * 1e9)
    print('{:09d}'.format(ns_cor))

main()
