An index theorem for graphene