We study the number of s-element subsets J of a given abelian group G, such that |J + J| ≤ K|J|. Proving a conjecture of Alon, Balogh, Morris and Samotij, and improving a result of Green and Morris, who proved the conjecture for K fixed, we provide an upper bound on the number of such sets which is tight up to a factor of 2 o(s) , when G = Z and K = o(s/(log n) 3 ). We also provide a generalization of this result to arbitrary abelian groups which is tight up to a factor of 2 o(s) in many cases. The main tool used in the proof is the asymmetric container lemma, introduced recently by Morris, Samotij and Saxton. 2 δs 1 2 Ks s sets J ⊂ [n] with |J| = s and |J + J| ≤ K|J|.The conjecture was later confirmed for K constant by Green and Morris [7]; in fact they proved a slightly more general result: for each fixed K and as s → ∞, the number Research partially supported by CNPq. 1 of sets J ⊂ [n] with |J| = s and |J + J| ≤ K|J| is at most 2 o(s) 1 2 Ks s n ⌊K+o(1)⌋ .The authors of [7] used this result to bound the size of the largest clique in a random Cayley graph and recently the result was also applied by Balogh, Liu, Sharifzadeh and Treglown [2] to determine the number of maximal sum-free sets in [n]. Our main theorem confirms Conjecture 1.1 for all K = o(s/(log n) 3 ). Theorem 1.2. Let s, n be integers and 2 ≤ K ≤ o s (log n) 3 . The number of sets J ⊂ [n] with |J| = s such that |J + J| ≤ K|J| is at most 2 o(s) 1 2 Ks s .We will in fact prove stronger bounds on the error term than those stated above, see Theorem 4.1. Nevertheless, we are unable to prove the conjecture in the range K = Ω(s/(log n) 3 ), and actually the conjecture is false for a certain range of values of s and K ≫ s/ log n. More precisely, for any integers n, s, and any positive numbers K, ǫ with min{s, n 1/2−ǫ } ≥ K ≥ 4 log(24C)s ǫ log n , there are at least n 2 K 4 Ks 8 s − K 4 ≥ CKs s sets J ⊂ [n] with |J| = s and |J + J| ≤ Ks. The construction 1 is very simple: let P be an arithmetic progression of size Ks/8 and set J = J 0 ∪ J 1 , where J 0 is any subset of P of size s − K/4, and J 1 is any subset of [n] \ P of size K/4. For convenience we provide the details in the appendix. Our methods also allow us to characterize the typical structure of an s-set with doubling constant K, and obtain the following result. Theorem 1.3. Let s, n be integers and 2 ≤ K ≤ o s (log n) 3 . For almost all sets J ⊂ [n]with |J| = s such that |J + J| ≤ K|J|, there is a set T ⊂ J such that J \ T is contained in an arithmetic progression of size 1+o(1) 2 Ks and |T | = o(s). In the case s = Ω(n) (and hence K = O(1)), this result was proved by Mazur [10]. We will provide better bounds for the error terms in Theorem 5.1, below.