The streets of a city form a regular, chessboard-like grid: every street runs either north-south (an NS-street) or west-east (a WE-street), and each street spans the whole city. Every NS-street intersects every WE-street and vice versa. The NS-streets are numbered from 1 to n starting from the westernmost, and the WE-streets are numbered from 1 to m starting from the southernmost. The intersection of the i-th NS-street with the j-th WE-street is denoted by the pair (i,j) (for 1≤i≤n, 1≤j≤m).
A bus line uses these intersections as stops. The bus starts at intersection (1,1) and finishes at intersection (n,m), and it may move only east and/or north (that is, each move increases the NS-street number or the WE-street number).
Passengers wait at some of the intersections. The driver wants to choose a route that picks up as many passengers as possible (assume the bus is spacious enough to carry everyone it passes, regardless of the route chosen).
Write a program that reads a description of the road network and the number of passengers waiting at each intersection, and outputs the greatest number of passengers the bus can pick up.
The first line contains three positive integers n, m and k - the number of NS-streets, the number of WE-streets, and the number of intersections at which passengers are waiting (1≤n≤109, 1≤m≤109, 1≤k≤105).
Each of the next k lines describes one intersection with three space-separated positive integers xi, yi and pi (1≤xi≤n, 1≤yi≤m, 1≤pi≤106), meaning that pi passengers wait at intersection (xi,yi). Each intersection appears at most once in the input. The total number of waiting passengers does not exceed 109.
Output a single line with one integer: the greatest number of passengers the bus can pick up.
