Given that $$a+d+c=5, b+c+d=4$$, $$a =3$$, either one of $$d$$ or $$c$$ is one half of $$a$$, and the other is half of $$a-1$$. Find $$a+b+c+d$$.