n = int(input()) total = 1024-n #枚举硬币 枚举背包 完全背包 ans = float('inf') dp = [float('inf')] * (total+1) dp[0] = 0 for i in [1,4,16,64]: for j in range(i,total+1): dp[j] = min(dp[j],dp[j-i]+1)#要用到当前的迭代结果 print(dp[total])