# How can I calculate the number of degrees of freedom in the Elastic Net regularization, specifically in R?

In the elastic net, and specifically in glment package in R - how would I obtain the number of degrees of freedom? Note that in the Glmnet Vignette it says that the df you get from the ouput after an Elastic Net model is the number of effective degrees of freedom for the LASSO! I'm using elastic net with alpha = 0.5, so the question is what do I use for the degrees of freedom? (I need that to compute AIC manually)