#!/bin/python

import sys

def raceAgainstTime(n, mason_height, heights, prices):
    # Complete this function

if __name__ == "__main__":
    n = int(raw_input().strip())
    mason_height = int(raw_input().strip())
    heights = map(int, raw_input().strip().split(' '))
    prices = map(int, raw_input().strip().split(' '))
    result = raceAgainstTime(n, mason_height, heights, prices)
    print result