A commuter travelling home for Christmas found the motorways busy.

In the first hour he covered two fifths of the total distance.

The next hour he covered one quarter of what was left.

The following hour he covered two fifths of the remainder and in the fourth hour half of the remaining distance.

The commuter was still 18 kms from home.

How many kms had he travelled?