===INPUT=== 30 4 7 ===OUTPUT=== 454 ===END===