According to E Porter Alexander (Military Memoirs of a Confederate, p. 313), the losses were:
On Longstreet's flank (Marye's Heights) US 7,817; CS 1,589
On Jackson's flank US 4,447; CS 3,415
There was also some skirmishing in the center costing 383 US and 305 CS casualties.
Comparatively speaking, not costly for the Confederacy as far as major battles tended to go. The contrast between Meade's unsupported temporary breakthrough and Burnside's futile hammering of a well-placed defensive position is notable.