Let a,b,c, and d be real numbers such that \[a^2 + 3b^2 + \frac{c^2+3d^2}{2} = a + b + c+d-1.\] Find $1000a + 100b + 10c + d$.

Let's think step by step and output the final answer within \boxed{}.
user