<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with 5 vertices and edges (0, 1), (1, 2), (2, 3), (3, 4), how can you count the total number of edges present in the graph using the ecount method from the igraph library?
### Response:
from igraph import Graph

# Create a new directed graph with edges
g = Graph(directed=True)
g.add_vertices(5)
g.add_edges([(0, 1), (1, 2), (2, 3), (3, 4)])

# Count the number of edges in the graph
edge_count = g.ecount()
print('Number of edges:', edge_count)
<|EOT|>
