t=int(input())print(min(t*3,(t>300)*(299+(t-300)*3)+(t<=300)*(299),(t>750)*(699+(t-750)*3)+(t<=750)*(699)))