Suppose that a,b,c,d are four distinct positive integers. A greatest possible number m and a least possible number n are formed by using the four numbers {a,b,c,d} as digits. If m+n=1330 and m,nare both four-digit numbers, what is the value of a+b+c+d?