#K14151. Maximum Assignable Tasks

    ID: 24071 Type: Default 1000ms 256MiB

Maximum Assignable Tasks

Maximum Assignable Tasks

You are given n developers and m tasks. Each developer has a certain skill level and each task requires a certain minimum skill level to complete. Each developer can be assigned at most one task.

The objective is to assign tasks to developers such that a task can only be assigned to a developer if the developer's skill level is greater than or equal to the task's requirement. Formally, if a developer has skill s and a task requires skill r, then the assignment is possible only if $$s \geq r$$.

Your task is to determine the maximum number of tasks that can be assigned following these rules.

inputFormat

The first line contains two integers n and m — the number of developers and tasks respectively.

The second line contains n integers denoting the skill levels of the developers.

The third line contains m integers denoting the required skill levels for the tasks.

outputFormat

Output a single integer representing the maximum number of tasks that can be assigned following the rules above.

## sample
4 5
3 1 4 2
2 1 3 2 5
4