The general rule for a vent pipe is to be as short and as straight as practical. However, elbows are permitted to some extent. First option is to use Gama venting tables (http://icpindexing.toddsit.com/documents/003046/gama%20vent%20tab.pdf) to calculate capacity of the B-vent pipe with those elbows installed.
When the ofset includes more than two 90° elbows (entire run of the flue pipe / if you have them by the water heater they count for the attic offset as well) you should subtract 5% from the table capacity for each elbow up to 45° & 10% for each elobow up to 90°.
If you're not using Gama vent tables you are only allowed one 60° offset and flue offsets smaller or equal 45° only if total horizontal length of the connector and the vent pipe is less or equal 75% of its height.
Let me know if this helped.