What is the difference between Data Hazard and Dependencies in Pipelining
I think a dependency is something you see by looking at the code and trying to figure out possible WAW, WAR, RAW hazards that could happen. Actual hazards instead are a property of the pipeline which means that a dependency you found earlier may or may not generate an hazard depending on the actual code execution in the processor. 
In your example there's an output dependency between the instructions I2 - I4, but if we assume that the pipeline does not stall for any reason between the two and that the execution time for each instr. is the same, I2 wll be completed before I4 thus not generating any hazard. 
To make the answer more clear, with the information you give about the excercise it's impossible to know the number of hazards because we don't know the architecture on which that code is executed nor the state of the pipeline. 
I found your question searching for an answer so I'm not completely sure. Since you asked some months ago maybe you already found the correct answer. If so could you share it please ?